Skip to content

Conversation

@owenv
Copy link
Contributor

@owenv owenv commented Oct 15, 2025

Adopt the new package and remove duplicated code

@owenv
Copy link
Contributor Author

owenv commented Oct 15, 2025

I expect I'll need to iterate on this a bit. swiftlang/swift#84882 needs to land before it's testable in CI

@owenv owenv force-pushed the owenv/adopt-swift-tools-protocols branch from cecc4f7 to c77d687 Compare October 21, 2025 23:20
@owenv
Copy link
Contributor Author

owenv commented Oct 21, 2025

@swift-ci test

@owenv owenv force-pushed the owenv/adopt-swift-tools-protocols branch from c77d687 to 6de2320 Compare October 22, 2025 16:59
@owenv
Copy link
Contributor Author

owenv commented Oct 22, 2025

@swift-ci test

@owenv
Copy link
Contributor Author

owenv commented Oct 22, 2025

@swift-ci test Windows

@owenv owenv force-pushed the owenv/adopt-swift-tools-protocols branch from 6de2320 to 31793f4 Compare October 22, 2025 19:40
@owenv
Copy link
Contributor Author

owenv commented Oct 22, 2025

@swift-ci test

@owenv owenv force-pushed the owenv/adopt-swift-tools-protocols branch from 31793f4 to 84b1416 Compare October 22, 2025 22:54
@owenv
Copy link
Contributor Author

owenv commented Oct 22, 2025

@swift-ci test

@owenv
Copy link
Contributor Author

owenv commented Oct 22, 2025

@swift-ci test Windows

@owenv owenv force-pushed the owenv/adopt-swift-tools-protocols branch from 8f0f529 to 83337ec Compare October 29, 2025 16:32
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High-level comment: I’d like to investigate if we can reduce the dependency on ToolsProtocolsSwiftExtensions further but that can be a follow-up investigation.

let buildSettingsFromBuildServer = await orLog("Getting build settings") {
if fallbackAfterTimeout {
try await withTimeout(options.buildSettingsTimeoutOrDefault) {
try await SwiftExtensions.withTimeout(options.buildSettingsTimeoutOrDefault) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to module-qualify this? Shouldn’t this be at a below-SPI access level in swift-tools-protocols and thus there wouldn’t be a name conflict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

extension BuildTargetIdentifier: CustomLogStringConvertible {
@_spi(SourceKitLSP) extension BuildTargetIdentifier: @retroactive CustomLogStringConvertible {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, should this conformance be in swift-tools-protocols? Seems like most people would need to add it. Though I’m not quite sure which module that conformance would live in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could put it in LanguageServerProtocolTransport although it's a bit of a stretch

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, hit submit to early

@@ -234,18 +234,20 @@ struct SourceKitLSP: AsyncParsableCommand {
fatalError("failed to redirect stdout -> stderr: \(strerror(errno)!)")
}

LoggingScope.configureDefaultLoggingSubsystem("org.swift.sourcekit-lsp")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is a little tricky. We’d need to do the same in at least one other places (part from test execution), namely when launching a SourceKitLSP server in-processes using InProcessClient

@@ -82,6 +83,10 @@ private func createBuildServerManager(
}

final class BuildServerManagerTests: XCTestCase {
override func setUp() async throws {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really dislike having this setUp function in every single test case. Should we instead have a custom class that inherits from XCTestCase and that all our test cases inherit from?

Also, could we make LoggingScope.subsystem not fatalError if no default logging subsystem was set? Instead, maybe just use org.swift or default and log a fault that no logging subsystem has been set? There’s no need to crash the process just because no logging subsystem has been configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can get behind not crashing, swiftlang/swift-tools-protocols#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants