Skip to content

Move ClangLanguageService to its own module #2228

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 4 commits into from
Aug 11, 2025

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 4, 2025

I’m working on moving each of the three language services to its own module, ie. having a separate module for ClangLanguageService, SwiftLanguageService, and DocumentationLanguageService. This should separate concerns for the three languages a little better instead of having them all in the single SourceKitLSP module.

The overall design is that the modules for the language services depend on the SourceKitLSP module, so the language services need to be registered dynamically in a LanguageServiceRegistry. Other than that, a bit of code needed to be moved around but the changes should all be NFCs.

https://github.com/ahoppen/sourcekit-lsp/tree/split-language-services contains the result of the final split. Getting there will probably take another couple of PRs.

@ahoppen
Copy link
Member Author

ahoppen commented Aug 4, 2025

@swift-ci Please test

@ahoppen ahoppen force-pushed the move-clanglanguageservice branch from c4d423d to 6e6fc85 Compare August 4, 2025 19:46
@ahoppen
Copy link
Member Author

ahoppen commented Aug 4, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Aug 7, 2025

@swift-ci Please test Windows

@@ -4,6 +4,7 @@ add_executable(sourcekit-lsp
target_link_libraries(sourcekit-lsp PRIVATE
BuildServerIntegration
Diagnose
InProcessClient
LanguageServerProtocol
LanguageServerProtocolExtensions
LanguageServerProtocolJSONRPC
Copy link
Contributor

@bnbarham bnbarham Aug 8, 2025

Choose a reason for hiding this comment

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

Not sure how this worked before, but we're apparently missing a DocCDocumentation here (we have a package import DocCDocumentation in Sources/SourceKitLSP/Workspace.swift)

Copy link
Member Author

Choose a reason for hiding this comment

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

That's because we can't build DocC on Windows. All usages of DocC should be guarded by #if. Maybe I missed a #if now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I forgot about that :(

@ahoppen ahoppen force-pushed the move-clanglanguageservice branch from 6e6fc85 to 634ec92 Compare August 11, 2025 07:02
@ahoppen
Copy link
Member Author

ahoppen commented Aug 11, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Aug 11, 2025

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 750ddf7 into swiftlang:main Aug 11, 2025
3 checks passed
@ahoppen ahoppen deleted the move-clanglanguageservice branch August 11, 2025 15:39
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