diff --git a/.devcontainer/default/devcontainer.json b/.devcontainer/default/devcontainer.json index f2733453e..7f2e5fe85 100644 --- a/.devcontainer/default/devcontainer.json +++ b/.devcontainer/default/devcontainer.json @@ -9,9 +9,7 @@ "mounts": [ // Use a named volume for the build products for optimal performance (https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-a-targeted-named-volume) - "source=${localWorkspaceFolderBasename}-build,target=${containerWorkspaceFolder}/.build,type=volume", - // Do the same for experimental background indexing - "source=${localWorkspaceFolderBasename}-index-build,target=${containerWorkspaceFolder}/.index-build,type=volume" + "source=${localWorkspaceFolderBasename}-build,target=${containerWorkspaceFolder}/.build,type=volume" ], "customizations": { "vscode": { diff --git a/Documentation/Enable Experimental Background Indexing.md b/Documentation/Enable Experimental Background Indexing.md index 3d4d6fd2c..1075daa09 100644 --- a/Documentation/Enable Experimental Background Indexing.md +++ b/Documentation/Enable Experimental Background Indexing.md @@ -34,4 +34,4 @@ By default SourceKit-LSP does not update its global index in the background or b 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. +- Your project including the `.build` folder, if possible. diff --git a/Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift b/Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift index dd4438302..6f58cdfcb 100644 --- a/Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift +++ b/Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift @@ -207,7 +207,7 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem { package let connectionToSourceKitLSP: any Connection - /// Whether the `SwiftPMBuildSystem` is pointed at a `.index-build` directory that's independent of the + /// Whether the `SwiftPMBuildSystem` is pointed at a `.build/index-build` directory that's independent of the /// user's build. private var isForIndexBuild: Bool { options.backgroundIndexingOrDefault } @@ -322,7 +322,7 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem { fileSystem: localFileSystem ) if options.backgroundIndexingOrDefault { - location.scratchDirectory = AbsolutePath(projectRoot.appending(component: ".index-build")) + location.scratchDirectory = AbsolutePath(projectRoot.appending(components: ".build", "index-build")) } else if let scratchDirectory = options.swiftPMOrDefault.scratchPath, let scratchDirectoryPath = try? AbsolutePath(validating: scratchDirectory) { diff --git a/Tests/SourceKitLSPTests/BackgroundIndexingTests.swift b/Tests/SourceKitLSPTests/BackgroundIndexingTests.swift index 11fc1642a..9aec90aac 100644 --- a/Tests/SourceKitLSPTests/BackgroundIndexingTests.swift +++ b/Tests/SourceKitLSPTests/BackgroundIndexingTests.swift @@ -868,7 +868,8 @@ final class BackgroundIndexingTests: XCTestCase { let nestedIndexBuildURL = try XCTUnwrap( project.uri(for: "OtherLib.swift").fileURL? .deletingLastPathComponent() - .appendingPathComponent(".index-build") + .appendingPathComponent(".build") + .appendingPathComponent("index-build") ) XCTAssertFalse( FileManager.default.fileExists(at: nestedIndexBuildURL), @@ -1237,7 +1238,7 @@ final class BackgroundIndexingTests: XCTestCase { // Simulate a package update which goes as follows: // - The user runs `swift package update` // - This updates `Package.resolved`, which we watch - // - We reload the package, which updates `Dependency.swift` in `.index-build/checkouts`, which we also watch. + // - We reload the package, which updates `Dependency.swift` in `.build/index-build/checkouts`, which we also watch. try await Process.run( arguments: [ unwrap(ToolchainRegistry.forTesting.default?.swift?.pathString),