diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96bb08add..648e4969b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,7 +109,7 @@ To enable more verbose logging on non-macOS platforms, launch sourcekit-lsp with ## Formatting -SourceKit-LSP is formatted using [swift-format](http://github.com/apple/swift-format) to ensure a consistent style. +SourceKit-LSP is formatted using [swift-format](http://github.com/swiftlang/swift-format) to ensure a consistent style. To format your changes run the formatter using the following command ```bash @@ -156,7 +156,7 @@ In order for a pull request to be considered for inclusion in a release branch ( ``` > [!TIP] -> The PR description can be generated using the [release_branch.md](https://github.com/apple/sourcekit-lsp/blob/main/.github/PULL_REQUEST_TEMPLATE/release_branch.md) [pull request template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates). To use this template when creating a PR, you need to add the query parameter: +> The PR description can be generated using the [release_branch.md](https://github.com/swiftlang/sourcekit-lsp/blob/main/.github/PULL_REQUEST_TEMPLATE/release_branch.md) [pull request template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates). To use this template when creating a PR, you need to add the query parameter: > ``` > ?expand=1&template=release_branch.md > ``` diff --git a/Documentation/Enable Experimental Background Indexing.md b/Documentation/Enable Experimental Background Indexing.md index cacf766be..1164149e0 100644 --- a/Documentation/Enable Experimental Background Indexing.md +++ b/Documentation/Enable Experimental Background Indexing.md @@ -15,18 +15,18 @@ Background indexing in SourceKit-LSP is available as an experimental feature. Th ## Known issues -- Background Indexing is only supported for SwiftPM projects [#1269](https://github.com/apple/sourcekit-lsp/issues/1269), [#1271](https://github.com/apple/sourcekit-lsp/issues/1271) -- If a module or one of its dependencies has a compilation error, it cannot be properly prepared for indexing because we are running a regular `swift build` to generate its modules [#1254](https://github.com/apple/sourcekit-lsp/issues/1254) rdar://128683404 +- Background Indexing is only supported for SwiftPM projects [#1269](https://github.com/swiftlang/sourcekit-lsp/issues/1269), [#1271](https://github.com/swiftlang/sourcekit-lsp/issues/1271) +- If a module or one of its dependencies has a compilation error, it cannot be properly prepared for indexing because we are running a regular `swift build` to generate its modules [#1254](https://github.com/swiftlang/sourcekit-lsp/issues/1254) rdar://128683404 - Workaround 1: Ensure that your files dependencies are in a buildable state to get an up-to-date index and proper cross-module functionality - Workaround 2: Enable the `swiftpm-prepare-for-indexing` experimental feature, which continues to build Swift module even in the presence of errors. -- If you change a function in a way that changes its USR but keeps it API compatible (such as adding a defaulted parameter), references to it will be lost and not re-indexed automatically [#1264](https://github.com/apple/sourcekit-lsp/issues/1264) +- If you change a function in a way that changes its USR but keeps it API compatible (such as adding a defaulted parameter), references to it will be lost and not re-indexed automatically [#1264](https://github.com/swiftlang/sourcekit-lsp/issues/1264) - Workaround: Make some edit to the files that had references to re-index them -- The index build is currently completely separate from the command line build generated using `swift build`. Building *does not* update the index (break your habits of always building!) [#1270](https://github.com/apple/sourcekit-lsp/issues/1270) -- The initial indexing might take 2-3x more time than a regular build [#1254](https://github.com/apple/sourcekit-lsp/issues/1254), [#1262](https://github.com/apple/sourcekit-lsp/issues/1262), [#1268](https://github.com/apple/sourcekit-lsp/issues/1268) +- The index build is currently completely separate from the command line build generated using `swift build`. Building *does not* update the index (break your habits of always building!) [#1270](https://github.com/swiftlang/sourcekit-lsp/issues/1270) +- The initial indexing might take 2-3x more time than a regular build [#1254](https://github.com/swiftlang/sourcekit-lsp/issues/1254), [#1262](https://github.com/swiftlang/sourcekit-lsp/issues/1262), [#1268](https://github.com/swiftlang/sourcekit-lsp/issues/1268) - Spurious re-indexing of ~10-20 source files when `swift build` writes a header to the build directory [rdar://128573306](rdar://128573306) ## Filing issues -If you hit any issues that are not mentioned above, please [file a GitHub issue](https://github.com/apple/sourcekit-lsp/issues/new/choose) and attach the following information, if possible: +If you hit any issues that are not mentioned above, please [file a GitHub issue](https://github.com/swiftlang/sourcekit-lsp/issues/new/choose) and attach the following information, if possible: - A diagnostic bundle generated by running `path/to/sourcekit-lsp diagnose`. - Your project including the `.index-build` folder, if possible. diff --git a/Documentation/Overview.md b/Documentation/Overview.md index 331cbff5e..830e0ba14 100644 --- a/Documentation/Overview.md +++ b/Documentation/Overview.md @@ -12,7 +12,7 @@ After the message has been decoded, the `SourceKitLSPServer` handles it on its ` To provide language-specific functionality `SourceKitLSPServer` delegates to the types that implement `LanguageService`. This is either `SwiftLanguageService`, which implements language functionality for Swift files based on sourcekitd and swift-syntax, or `ClangLanguageService`, which launches a `clangd` process to provide functionality for C, C++, Objective-C and Objective-C++. -For requests that require knowledge about the project’s index, like call hierarchy or rename of global symbols, `SourceKitLSPServer` enriches the information returned from the language service with information from the [index](http://github.com/apple/indexstore-db/). +For requests that require knowledge about the project’s index, like call hierarchy or rename of global symbols, `SourceKitLSPServer` enriches the information returned from the language service with information from the [index](http://github.com/swiftlang/indexstore-db/). ### sourcekitd diff --git a/Package.swift b/Package.swift index a3fe02692..765a7f8f9 100644 --- a/Package.swift +++ b/Package.swift @@ -467,14 +467,14 @@ var dependencies: [Package.Dependency] { let relatedDependenciesBranch = "main" return [ - .package(url: "https://github.com/apple/indexstore-db.git", branch: relatedDependenciesBranch), - .package(url: "https://github.com/apple/swift-package-manager.git", branch: relatedDependenciesBranch), + .package(url: "https://github.com/swiftlang/indexstore-db.git", branch: relatedDependenciesBranch), + .package(url: "https://github.com/swiftlang/swift-package-manager.git", branch: relatedDependenciesBranch), .package(url: "https://github.com/apple/swift-tools-support-core.git", branch: relatedDependenciesBranch), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"), - .package(url: "https://github.com/apple/swift-syntax.git", branch: relatedDependenciesBranch), + .package(url: "https://github.com/swiftlang/swift-syntax.git", branch: relatedDependenciesBranch), .package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"), // Not a build dependency. Used so the "Format Source Code" command plugin can be used to format sourcekit-lsp - .package(url: "https://github.com/apple/swift-format.git", branch: relatedDependenciesBranch), + .package(url: "https://github.com/swiftlang/swift-format.git", branch: relatedDependenciesBranch), ] } } diff --git a/README.md b/README.md index 2eb17f3fc..1950e5d96 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ https://www.swift.org/tools has a list of popular editors that support LSP and c ## Reporting Issues -If you should hit any issues while using SourceKit-LSP, we appreciate bug reports on [GitHub Issue](https://github.com/apple/sourcekit-lsp/issues/new/choose). +If you should hit any issues while using SourceKit-LSP, we appreciate bug reports on [GitHub Issue](https://github.com/swiftlang/sourcekit-lsp/issues/new/choose). > [!IMPORTANT] > SourceKit-LSP does not update its global index in the background or build Swift modules in the background. Thus, a lot of cross-module or global functionality is limited if the project hasn't been built recently. To update the index or rebuild the Swift modules, build the project. diff --git a/Sources/Diagnose/DiagnoseCommand.swift b/Sources/Diagnose/DiagnoseCommand.swift index e5746654b..02d5e93fb 100644 --- a/Sources/Diagnose/DiagnoseCommand.swift +++ b/Sources/Diagnose/DiagnoseCommand.swift @@ -399,7 +399,7 @@ public struct DiagnoseCommand: AsyncParsableCommand { """ Bundle created. - When filing an issue at https://github.com/apple/sourcekit-lsp/issues/new, + When filing an issue at https://github.com/swiftlang/sourcekit-lsp/issues/new, please attach the bundle located at \(bundlePath.path) """ diff --git a/Sources/SKCore/BuildServerBuildSystem.swift b/Sources/SKCore/BuildServerBuildSystem.swift index 90a451bf6..c00e88b9d 100644 --- a/Sources/SKCore/BuildServerBuildSystem.swift +++ b/Sources/SKCore/BuildServerBuildSystem.swift @@ -355,13 +355,13 @@ extension BuildServerBuildSystem: BuildSystem { public func sourceFiles() async -> [SourceFileInfo] { // BuildServerBuildSystem does not support syntactic test discovery or background indexing. - // (https://github.com/apple/sourcekit-lsp/issues/1173). + // (https://github.com/swiftlang/sourcekit-lsp/issues/1173). return [] } public func addSourceFilesDidChangeCallback(_ callback: @escaping () async -> Void) { // BuildServerBuildSystem does not support syntactic test discovery or background indexing. - // (https://github.com/apple/sourcekit-lsp/issues/1173). + // (https://github.com/swiftlang/sourcekit-lsp/issues/1173). } } diff --git a/Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift b/Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift index 53cbc7e83..ff90fc38e 100644 --- a/Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift +++ b/Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift @@ -478,7 +478,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem { public func defaultLanguage(for document: DocumentURI) -> Language? { // TODO (indexing): Query The SwiftPM build system for the document's language. - // https://github.com/apple/sourcekit-lsp/issues/1267 + // https://github.com/swiftlang/sourcekit-lsp/issues/1267 return nil } @@ -534,7 +534,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem { // Files that occur before the target in the topological sorting don't depend on it. // Ideally, we should consult the dependency graph here for more accurate dependency analysis instead of relying on - // a flattened list (https://github.com/apple/sourcekit-lsp/issues/1312). + // a flattened list (https://github.com/swiftlang/sourcekit-lsp/issues/1312). return self.targets.compactMap { (configuredTarget, value) -> ConfiguredTarget? in if let minimumTargetIndex, value.index <= minimumTargetIndex { return nil @@ -548,7 +548,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem { logMessageToIndexLog: @escaping @Sendable (_ taskID: IndexTaskID, _ message: String) -> Void ) async throws { // TODO (indexing): Support preparation of multiple targets at once. - // https://github.com/apple/sourcekit-lsp/issues/1262 + // https://github.com/swiftlang/sourcekit-lsp/issues/1262 for target in targets { await orLog("Preparing") { try await prepare(singleTarget: target, logMessageToIndexLog: logMessageToIndexLog) } } @@ -566,7 +566,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem { } // TODO (indexing): Add a proper 'prepare' job in SwiftPM instead of building the target. - // https://github.com/apple/sourcekit-lsp/issues/1254 + // https://github.com/swiftlang/sourcekit-lsp/issues/1254 guard let swift = toolchain.swift else { logger.error( "Not preparing because toolchain at \(self.toolchain.identifier) does not contain a Swift compiler" @@ -741,7 +741,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem { public func sourceFiles() -> [SourceFileInfo] { return fileToTargets.compactMap { (uri, targets) -> SourceFileInfo? in // We should only set mayContainTests to `true` for files from test targets - // (https://github.com/apple/sourcekit-lsp/issues/1174). + // (https://github.com/swiftlang/sourcekit-lsp/issues/1174). return SourceFileInfo( uri: uri, isPartOfRootProject: targets.contains(where: \.isPartOfRootPackage), diff --git a/Sources/SKTestSupport/SkipUnless.swift b/Sources/SKTestSupport/SkipUnless.swift index df66957a0..bb1cd45c7 100644 --- a/Sources/SKTestSupport/SkipUnless.swift +++ b/Sources/SKTestSupport/SkipUnless.swift @@ -207,7 +207,7 @@ public actor SkipUnless { } /// SwiftPM moved the location where it stores Swift modules to a subdirectory in - /// https://github.com/apple/swift-package-manager/pull/7103. + /// https://github.com/swiftlang/swift-package-manager/pull/7103. public static func swiftpmStoresModulesInSubdirectory( file: StaticString = #filePath, line: UInt = #line diff --git a/Sources/SemanticIndex/SemanticIndexManager.swift b/Sources/SemanticIndex/SemanticIndexManager.swift index 63511f200..c0a1979d6 100644 --- a/Sources/SemanticIndex/SemanticIndexManager.swift +++ b/Sources/SemanticIndex/SemanticIndexManager.swift @@ -602,7 +602,7 @@ public final actor SemanticIndexManager { // TODO (indexing): When we can index multiple targets concurrently in SwiftPM, increase the batch size to half the // processor count, so we can get parallelism during preparation. - // https://github.com/apple/sourcekit-lsp/issues/1262 + // https://github.com/swiftlang/sourcekit-lsp/issues/1262 for targetsBatch in sortedTargets.partition(intoBatchesOfSize: 1) { let preparationTaskID = UUID() let indexTask = Task(priority: priority) { @@ -614,7 +614,7 @@ public final actor SemanticIndexManager { for target in targetsBatch { // TODO (indexing): Once swiftc supports indexing of multiple files in a single invocation, increase the // batch size to allow it to share AST builds between multiple files within a target. - // https://github.com/apple/sourcekit-lsp/issues/1268 + // https://github.com/swiftlang/sourcekit-lsp/issues/1268 for fileBatch in filesByTarget[target]!.partition(intoBatchesOfSize: 1) { taskGroup.addTask { await self.updateIndexStore( diff --git a/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift b/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift index 85f0f8445..a42200d06 100644 --- a/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift +++ b/Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift @@ -169,7 +169,7 @@ public struct UpdateIndexStoreTaskDescription: IndexTaskDescription { let filesToIndex = filesToIndex.sorted(by: { $0.file.sourceFile.stringValue < $1.file.sourceFile.stringValue }) // TODO (indexing): Once swiftc supports it, we should group files by target and index files within the same // target together in one swiftc invocation. - // https://github.com/apple/sourcekit-lsp/issues/1268 + // https://github.com/swiftlang/sourcekit-lsp/issues/1268 for file in filesToIndex { await updateIndexStore(forSingleFile: file.file, in: file.target) } diff --git a/Tests/SourceKitLSPTests/PullDiagnosticsTests.swift b/Tests/SourceKitLSPTests/PullDiagnosticsTests.swift index 762887f79..85b0fa970 100644 --- a/Tests/SourceKitLSPTests/PullDiagnosticsTests.swift +++ b/Tests/SourceKitLSPTests/PullDiagnosticsTests.swift @@ -42,7 +42,7 @@ final class PullDiagnosticsTests: XCTestCase { XCTAssertEqual(diagnostic.range, Position(line: 1, utf16index: 2)..