Skip to content

Merge main into release/6.1 #1879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 76 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c0c0f1f
Skip tests that use background indexing when running tests with a Swi…
ahoppen Nov 18, 2024
be54630
Use `URL` in many cases where we used `AbsolutePath`
ahoppen Nov 18, 2024
184fa12
Allow `scratchPath` to be relative paths
kateinoigakukun Nov 15, 2024
d8db60e
Enable `MemberImportVisibility` in the CMake build
ahoppen Nov 19, 2024
98b55ba
Merge pull request #1833 from ahoppen/fix-510-tests
ahoppen Nov 19, 2024
8eb5bfc
Merge pull request #1835 from ahoppen/enable-memberimportvisibility-w…
ahoppen Nov 19, 2024
a864391
Merge pull request #1832 from ahoppen/reduce-absolute-path
ahoppen Nov 19, 2024
8d13afa
Merge pull request #1824 from kateinoigakukun/katei/interpret-relativ…
ahoppen Nov 19, 2024
76304db
Fix merge conflict
ahoppen Nov 19, 2024
6c5f5c9
Merge pull request #1838 from ahoppen/merge-conflict
rjmccall Nov 19, 2024
bfaee49
Minor improvements to `DLHandle.Handle`
ahoppen Nov 20, 2024
a2eb7b9
Handle on-type formatting requests
MahdiBM Nov 21, 2024
3b6ced8
Merge pull request #1815 from MahdiBM/mmbm-on-type-formatting
ahoppen Nov 22, 2024
eb982d5
Fix quadratic performance issue in `AsyncQueue<Serial>`
ahoppen Nov 22, 2024
ea6f06f
Log integers and booleans as public information by default in `NonDar…
ahoppen Nov 22, 2024
e073a01
Reply with `null` to `shutdown` request
ahoppen Nov 22, 2024
14b8588
Don’t crash when opening a file with an empty path
ahoppen Nov 22, 2024
eb72e10
Fully qualify type names in call hierarchy, type hierarchy and worksp…
ahoppen Nov 22, 2024
cddd810
Provide build settings for version-specific package manifests
ahoppen Nov 22, 2024
62f005c
Add another import of new Android overlay and remove non-existent fil…
finagolfin Nov 30, 2024
ce2d687
Merge pull request #1848 from finagolfin/droid
ahoppen Dec 3, 2024
51634d8
Merge pull request #1840 from ahoppen/async-queue-quadratic
ahoppen Dec 3, 2024
4688242
Merge pull request #1841 from ahoppen/log-int-bool-public
ahoppen Dec 3, 2024
7a95075
Merge pull request #1842 from ahoppen/shutdown-null
ahoppen Dec 3, 2024
c85dd7c
Merge pull request #1843 from ahoppen/empty-path-crash
ahoppen Dec 3, 2024
9efa7e8
Merge pull request #1844 from ahoppen/fully-qualified-names
ahoppen Dec 3, 2024
14e119d
Merge pull request #1839 from ahoppen/dlhandle-improvements
ahoppen Dec 3, 2024
3131ca3
Merge pull request #1845 from ahoppen/version-specific-manifest
ahoppen Dec 3, 2024
e938dfa
include parameters in initializer document symbol
matthewbastien Nov 7, 2024
3ea9a65
include all resources in a build target's sources list
matthewbastien Dec 5, 2024
f2fed7a
reduce code duplication
matthewbastien Dec 5, 2024
8fd3090
handle *.md and *.tutorial files for Swift DocC
matthewbastien Dec 5, 2024
9446520
fix copyright header
matthewbastien Dec 5, 2024
60beed8
Customize closure expansion behavior
woolsweater Nov 11, 2024
b4cf0da
address review comments
matthewbastien Dec 5, 2024
9f3de1b
mark the tutorial language as a LSP extension
matthewbastien Dec 5, 2024
debb5dc
Merge pull request #1852 from matthewbastien/document-symbols
matthewbastien Dec 5, 2024
f900b4e
Merge pull request #1853 from matthewbastien/include-all-build-target…
matthewbastien Dec 5, 2024
990ec7f
Don’t implicitly cancel code completion requests on document edits
ahoppen Dec 5, 2024
8ea381d
Only load BSP servers that support one of the language we are interes…
ahoppen Dec 6, 2024
21dfaf0
Merge pull request #1831 from woolsweater/the-trail-is-closed
ahoppen Dec 6, 2024
5914efd
Log package loading messages to the index log
ahoppen Dec 6, 2024
1c9a15e
Log which file caused the package to be reloaded
ahoppen Dec 6, 2024
bb907a5
Don’t re-index file if we are waiting for its preparation
ahoppen Dec 6, 2024
9bbb8f3
Merge pull request #1854 from matthewbastien/documentation-language-s…
ahoppen Dec 6, 2024
751291e
Only show call-like occurrences in call hierarchy.
ahoppen Dec 6, 2024
67b98cd
Batch updates to the syntactic test index on fileDidChange events
ahoppen Dec 6, 2024
7c474fd
Treat `$/setTrace` as a freestanding message
ahoppen Dec 6, 2024
e038c79
Merge pull request #1860 from ahoppen/bsp-server-language
ahoppen Dec 6, 2024
7cc63f5
Merge pull request #1861 from ahoppen/log-package-loading
ahoppen Dec 6, 2024
b42e62f
Merge pull request #1862 from ahoppen/log-package-reload-trigger
ahoppen Dec 6, 2024
29619a6
Merge pull request #1864 from ahoppen/no-double-index
ahoppen Dec 6, 2024
697e65a
Improve logic for build graph generation status
ahoppen Dec 6, 2024
3887894
Create child scopes for SwiftPM operations
ahoppen Dec 6, 2024
ddbd654
Allow dependency updates in the `index-build` folder
ahoppen Dec 6, 2024
a61bbff
Cache path components for directories returned from build system
ahoppen Dec 6, 2024
1c1a1cf
Cached transformed results in `Cache`
ahoppen Dec 6, 2024
cbd897d
Don’t show warning message when opening projects that don't support b…
ahoppen Dec 6, 2024
2bf4776
Merge pull request #1868 from ahoppen/only-calls-in-call-hierarchy
ahoppen Dec 6, 2024
f376e66
Merge pull request #1869 from ahoppen/batch-filedidchange-syntacticindex
ahoppen Dec 6, 2024
ee1f4b1
Don’t escape `{` inside placeholder snippets
ahoppen Dec 6, 2024
14264b7
Merge pull request #1871 from ahoppen/settrace-freestanding
ahoppen Dec 6, 2024
f59fb2b
Merge pull request #1863 from ahoppen/index-schedule-progress
ahoppen Dec 6, 2024
3cf015a
Merge pull request #1866 from ahoppen/cache-path-components
ahoppen Dec 7, 2024
fad3c10
Merge pull request #1867 from ahoppen/cache-transformed
ahoppen Dec 7, 2024
5183889
Merge pull request #1872 from ahoppen/no-background-indexing-warning
ahoppen Dec 7, 2024
1a708ec
Merge pull request #1870 from ahoppen/no-escape-open-brace
ahoppen Dec 7, 2024
87af5b0
Merge pull request #1857 from ahoppen/no-implicit-completion-cancella…
ahoppen Dec 7, 2024
881f0f5
Merge pull request #1873 from ahoppen/swiftpm-child-scopes
ahoppen Dec 9, 2024
247acf6
Merge pull request #1874 from ahoppen/allow-dependency-updates
ahoppen Dec 9, 2024
a087692
Return compiler arguments for invalid package manifests
ahoppen Nov 22, 2024
e7f9530
Merge pull request #1846 from ahoppen/invalid-manifest-build-settings
atrick Dec 9, 2024
559eb1e
Merge remote-tracking branch 'swiftlang/main' into release/6.1
ahoppen Dec 10, 2024
85828ee
Revert "Merge pull request #1870 from ahoppen/no-escape-open-brace"
ahoppen Dec 10, 2024
c3f97b9
Revert "Merge pull request #1854 from matthewbastien/documentation-la…
ahoppen Dec 10, 2024
fd79c3d
Revert "Merge pull request #1831 from woolsweater/the-trail-is-closed"
ahoppen Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature InternalImportsByDefault>")
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature InternalImportsByDefault -enable-upcoming-feature MemberImportVisibility>")

find_package(dispatch QUIET)
find_package(Foundation QUIET)
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Configuration File.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The structure of the file is currently not guaranteed to be stable. Options may

- `swiftPM`: Dictionary with the following keys, defining options for SwiftPM workspaces
- `configuration: "debug"|"release"`: The configuration to build the project for during background indexing and the configuration whose build folder should be used for Swift modules if background indexing is disabled. Equivalent to SwiftPM's `--configuration` option.
- `scratchPath: string`: Build artifacts directory path. If nil, the build system may choose a default value. Equivalent to SwiftPM's `--scratch-path` option.
- `scratchPath: string`: Build artifacts directory path. If nil, the build system may choose a default value. This path can be specified as a relative path, which will be interpreted relative to the project root. Equivalent to SwiftPM's `--scratch-path` option.
- `swiftSDKsDirectory: string`: Equivalent to SwiftPM's `--swift-sdks-path` option
- `swiftSDK: string`: Equivalent to SwiftPM's `--swift-sdk` option
- `triple: string`: Equivalent to SwiftPM's `--triple` option
Expand Down Expand Up @@ -51,5 +51,5 @@ The structure of the file is currently not guaranteed to be stable. Options may
- `noLazy`: Prepare a target without generating object files but do not do lazy type checking and function body skipping
- `enabled`: Prepare a target without generating object files and the like
- `cancelTextDocumentRequestsOnEditAndClose: bool`: Whether sending a `textDocument/didChange` or `textDocument/didClose` notification for a document should cancel all pending requests for that document.
- `experimentalFeatures: string[]`: Experimental features to enable
- `experimentalFeatures: string[]`: Experimental features to enable. Available features: on-type-formatting
- `swiftPublishDiagnosticsDebounceDuration: double`: The time that `SwiftLanguageService` should wait after an edit before starting to compute diagnostics and sending a `PublishDiagnosticsNotification`.
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ var targets: [Target] = [
"SKTestSupport",
"SourceKitLSP",
"ToolchainRegistry",
"TSCExtensions",
],
swiftSettings: globalSwiftSettings
),
Expand Down Expand Up @@ -348,7 +349,6 @@ var targets: [Target] = [
"Csourcekitd",
"SKLogging",
"SwiftExtensions",
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
],
exclude: ["CMakeLists.txt", "sourcekitd_uids.swift.gyb"],
swiftSettings: globalSwiftSettings
Expand Down Expand Up @@ -487,7 +487,6 @@ var targets: [Target] = [
"SwiftExtensions",
"TSCExtensions",
],
exclude: ["CMakeLists.txt"],
swiftSettings: globalSwiftSettings
),
]
Expand Down
72 changes: 42 additions & 30 deletions Sources/BuildSystemIntegration/BuildSystemManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if compiler(>=6)
package import BuildServerProtocol
import Dispatch
import Foundation
package import Foundation
package import LanguageServerProtocol
package import LanguageServerProtocolExtensions
import SKLogging
Expand All @@ -23,8 +23,7 @@ package import SwiftExtensions
package import ToolchainRegistry
import TSCExtensions

package import struct TSCBasic.AbsolutePath
package import struct TSCBasic.RelativePath
import struct TSCBasic.RelativePath
#else
import BuildServerProtocol
import Dispatch
Expand All @@ -38,7 +37,6 @@ import SwiftExtensions
import ToolchainRegistry
import TSCExtensions

import struct TSCBasic.AbsolutePath
import struct TSCBasic.RelativePath
#endif

Expand Down Expand Up @@ -138,31 +136,31 @@ private enum BuildSystemAdapter {

private extension BuildSystemSpec {
private static func createBuiltInBuildSystemAdapter(
projectRoot: AbsolutePath,
projectRoot: URL,
messagesToSourceKitLSPHandler: any MessageHandler,
buildSystemTestHooks: BuildSystemTestHooks,
_ createBuildSystem: @Sendable (_ connectionToSourceKitLSP: any Connection) async throws -> BuiltInBuildSystem?
) async -> BuildSystemAdapter? {
let connectionToSourceKitLSP = LocalConnection(
receiverName: "BuildSystemManager for \(projectRoot.asURL.lastPathComponent)"
receiverName: "BuildSystemManager for \(projectRoot.lastPathComponent)"
)
connectionToSourceKitLSP.start(handler: messagesToSourceKitLSPHandler)

let buildSystem = await orLog("Creating build system") {
try await createBuildSystem(connectionToSourceKitLSP)
}
guard let buildSystem else {
logger.log("Failed to create build system at \(projectRoot.pathString)")
logger.log("Failed to create build system at \(projectRoot)")
return nil
}
logger.log("Created \(type(of: buildSystem), privacy: .public) at \(projectRoot.pathString)")
logger.log("Created \(type(of: buildSystem), privacy: .public) at \(projectRoot)")
let buildSystemAdapter = BuiltInBuildSystemAdapter(
underlyingBuildSystem: buildSystem,
connectionToSourceKitLSP: connectionToSourceKitLSP,
buildSystemTestHooks: buildSystemTestHooks
)
let connectionToBuildSystem = LocalConnection(
receiverName: "\(type(of: buildSystem)) for \(projectRoot.asURL.lastPathComponent)"
receiverName: "\(type(of: buildSystem)) for \(projectRoot.lastPathComponent)"
)
connectionToBuildSystem.start(handler: buildSystemAdapter)
return .builtIn(buildSystemAdapter, connectionToBuildSystem: connectionToBuildSystem)
Expand All @@ -185,10 +183,10 @@ private extension BuildSystemSpec {
)
}
guard let buildSystem else {
logger.log("Failed to create external build system at \(projectRoot.pathString)")
logger.log("Failed to create external build system at \(projectRoot)")
return nil
}
logger.log("Created external build server at \(projectRoot.pathString)")
logger.log("Created external build server at \(projectRoot)")
return .external(buildSystem)
case .compilationDatabase:
return await Self.createBuiltInBuildSystemAdapter(
Expand Down Expand Up @@ -245,7 +243,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
/// For compilation databases it is the root folder based on which the compilation database was found.
///
/// `nil` if the `BuildSystemManager` does not have an underlying build system.
package let projectRoot: AbsolutePath?
package let projectRoot: URL?

/// The files for which the delegate has requested change notifications, ie. the files for which the delegate wants to
/// get `fileBuildSettingsChanged` and `filesDependenciesUpdated` callbacks.
Expand Down Expand Up @@ -340,7 +338,10 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
let files: [DocumentURI: SourceFileInfo]

/// The source directories in the workspace, ie. all `SourceItem`s that have `kind == .directory`.
let directories: [DocumentURI: SourceFileInfo]
///
/// `pathComponents` is the result of `key.fileURL?.pathComponents`. We frequently need these path components to
/// determine if a file is descendent of the directory and computing them from the `DocumentURI` is expensive.
let directories: [DocumentURI: (pathComponents: [String]?, info: SourceFileInfo)]
}

private let cachedSourceFilesAndDirectories = Cache<SourceFilesAndDirectoriesKey, SourceFilesAndDirectories>()
Expand Down Expand Up @@ -402,7 +403,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
displayName: "SourceKit-LSP",
version: "",
bspVersion: "2.2.0",
rootUri: URI(buildSystemSpec.projectRoot.asURL),
rootUri: URI(buildSystemSpec.projectRoot),
capabilities: BuildClientCapabilities(languageIds: [.c, .cpp, .objective_c, .objective_cpp, .swift])
)
)
Expand Down Expand Up @@ -608,7 +609,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
in target: BuildTargetIdentifier?,
language: Language
) async -> Toolchain? {
let toolchainPath = await orLog("Getting toolchain from build targets") { () -> AbsolutePath? in
let toolchainPath = await orLog("Getting toolchain from build targets") { () -> URL? in
guard let target else {
return nil
}
Expand All @@ -624,7 +625,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
logger.error("Toolchain is not a file URL")
return nil
}
return try AbsolutePath(validating: toolchainUrl.filePath)
return toolchainUrl
}
if let toolchainPath {
if let toolchain = await self.toolchainRegistry.toolchain(withPath: toolchainPath) {
Expand Down Expand Up @@ -681,14 +682,12 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
if let targets = filesAndDirectories.files[document]?.targets {
result.formUnion(targets)
}
if !filesAndDirectories.directories.isEmpty,
let documentPath = AbsolutePath(validatingOrNil: try? document.fileURL?.filePath)
{
for (directory, info) in filesAndDirectories.directories {
guard let directoryPath = AbsolutePath(validatingOrNil: try? directory.fileURL?.filePath) else {
if !filesAndDirectories.directories.isEmpty, let documentPathComponents = document.fileURL?.pathComponents {
for (directory, (directoryPathComponents, info)) in filesAndDirectories.directories {
guard let directoryPathComponents, let directoryPath = directory.fileURL else {
continue
}
if documentPath.isDescendant(of: directoryPath) {
if isDescendant(documentPathComponents, of: directoryPathComponents) {
result.formUnion(info.targets)
}
}
Expand Down Expand Up @@ -1013,19 +1012,21 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
return []
}

let request = BuildTargetSourcesRequest(targets: targets.sorted { $0.uri.stringValue < $1.uri.stringValue })

// If we have a cached request for a superset of the targets, serve the result from that cache entry.
let fromSuperset = await orLog("Getting source files from superset request") {
try await cachedTargetSources.get(isolation: self) { request in
targets.isSubset(of: request.targets)
} transform: { response in
return BuildTargetSourcesResponse(items: response.items.filter { targets.contains($0.target) })
}
try await cachedTargetSources.getDerived(
isolation: self,
request,
canReuseKey: { targets.isSubset(of: $0.targets) },
transform: { BuildTargetSourcesResponse(items: $0.items.filter { targets.contains($0.target) }) }
)
}
if let fromSuperset {
return fromSuperset.items
}

let request = BuildTargetSourcesRequest(targets: targets.sorted { $0.uri.stringValue < $1.uri.stringValue })
let response = try await cachedTargetSources.get(request, isolation: self) { request in
try await buildSystemAdapter.send(request)
}
Expand Down Expand Up @@ -1059,7 +1060,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {

return try await cachedSourceFilesAndDirectories.get(key, isolation: self) { key in
var files: [DocumentURI: SourceFileInfo] = [:]
var directories: [DocumentURI: SourceFileInfo] = [:]
var directories: [DocumentURI: (pathComponents: [String]?, info: SourceFileInfo)] = [:]
for sourcesItem in key.sourcesItems {
let target = targets[sourcesItem.target]?.target
let isPartOfRootProject = !(target?.tags.contains(.dependency) ?? false)
Expand All @@ -1081,7 +1082,9 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
case .file:
files[sourceItem.uri] = info.merging(files[sourceItem.uri])
case .directory:
directories[sourceItem.uri] = info.merging(directories[sourceItem.uri])
directories[sourceItem.uri] = (
sourceItem.uri.fileURL?.pathComponents, info.merging(directories[sourceItem.uri]?.info)
)
}
}
}
Expand Down Expand Up @@ -1230,3 +1233,12 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
}
}
}

/// Returns `true` if the path components `selfPathComponents`, retrieved from `URL.pathComponents` are a descendent
/// of the other path components.
///
/// This operates directly on path components instead of `URL`s because computing the path components of a URL is
/// expensive and this allows us to cache the path components.
private func isDescendant(_ selfPathComponents: [String], of otherPathComponents: [String]) -> Bool {
return selfPathComponents.dropLast().starts(with: otherPathComponents)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import BuildServerProtocol
package import LanguageServerProtocol
import LanguageServerProtocolExtensions
import SKLogging
import SwiftExtensions
package import SwiftExtensions
#else
import BuildServerProtocol
import LanguageServerProtocol
Expand Down Expand Up @@ -82,6 +82,10 @@ package enum BuildSystemMessageDependencyTracker: QueueBasedMessageHandlerDepend
}
}

package func dependencies(in pendingTasks: [PendingTask<Self>]) -> [PendingTask<Self>] {
return pendingTasks.filter { $0.metadata.isDependency(of: self) }
}

package init(_ request: some RequestType) {
switch request {
case is BuildShutdownRequest:
Expand Down
14 changes: 5 additions & 9 deletions Sources/BuildSystemIntegration/BuiltInBuildSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,18 @@

#if compiler(>=6)
package import BuildServerProtocol
package import Foundation
package import LanguageServerProtocol
import SKLogging
import SKOptions
import ToolchainRegistry

package import struct TSCBasic.AbsolutePath
package import struct TSCBasic.RelativePath
#else
import BuildServerProtocol
import Foundation
import LanguageServerProtocol
import SKLogging
import SKOptions
import ToolchainRegistry

import struct TSCBasic.AbsolutePath
import struct TSCBasic.RelativePath
#endif

/// An error build systems can throw from `prepare` if they don't support preparation of targets.
Expand All @@ -42,16 +38,16 @@ package protocol BuiltInBuildSystem: AnyObject, Sendable {
/// The root of the project that this build system manages. For example, for SwiftPM packages, this is the folder
/// containing Package.swift. For compilation databases it is the root folder based on which the compilation database
/// was found.
var projectRoot: AbsolutePath { get async }
var projectRoot: URL { get async }

/// The files to watch for changes.
var fileWatchers: [FileSystemWatcher] { get async }

/// The path to the raw index store data, if any.
var indexStorePath: AbsolutePath? { get async }
var indexStorePath: URL? { get async }

/// The path to put the index database, if any.
var indexDatabasePath: AbsolutePath? { get async }
var indexDatabasePath: URL? { get async }

/// Whether the build system is capable of preparing a target for indexing, ie. if the `prepare` methods has been
/// implemented.
Expand Down
19 changes: 10 additions & 9 deletions Sources/BuildSystemIntegration/BuiltInBuildSystemAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//

import BuildServerProtocol
import Foundation
import LanguageServerProtocol
import LanguageServerProtocolExtensions
import SKLogging
Expand All @@ -20,11 +19,9 @@ import SwiftExtensions
import ToolchainRegistry

#if compiler(>=6)
package import struct TSCBasic.AbsolutePath
package import struct TSCBasic.RelativePath
package import Foundation
#else
import struct TSCBasic.AbsolutePath
import struct TSCBasic.RelativePath
import Foundation
#endif

/// The details necessary to create a `BuildSystemAdapter`.
Expand All @@ -38,9 +35,9 @@ package struct BuildSystemSpec {

package var kind: Kind

package var projectRoot: AbsolutePath
package var projectRoot: URL

package init(kind: BuildSystemSpec.Kind, projectRoot: AbsolutePath) {
package init(kind: BuildSystemSpec.Kind, projectRoot: URL) {
self.kind = kind
self.projectRoot = projectRoot
}
Expand Down Expand Up @@ -95,8 +92,12 @@ actor BuiltInBuildSystemAdapter: QueueBasedMessageHandler {
capabilities: BuildServerCapabilities(),
dataKind: .sourceKit,
data: SourceKitInitializeBuildResponseData(
indexDatabasePath: await underlyingBuildSystem.indexDatabasePath?.pathString,
indexStorePath: await underlyingBuildSystem.indexStorePath?.pathString,
indexDatabasePath: await orLog("getting index database file path") {
try await underlyingBuildSystem.indexDatabasePath?.filePath
},
indexStorePath: await orLog("getting index store file path") {
try await underlyingBuildSystem.indexStorePath?.filePath
},
watchers: await underlyingBuildSystem.fileWatchers,
prepareProvider: underlyingBuildSystem.supportsPreparation,
sourceKitOptionsProvider: true
Expand Down
Loading