Skip to content

Move workspace symbol implementation out of SourceKitLSPServer.swift - #2746

Open
rintaro wants to merge 1 commit into
swiftlang:mainfrom
rintaro:extract-workspace-symbols
Open

Move workspace symbol implementation out of SourceKitLSPServer.swift#2746
rintaro wants to merge 1 commit into
swiftlang:mainfrom
rintaro:extract-workspace-symbols

Conversation

@rintaro

@rintaro rintaro commented Aug 8, 2026

Copy link
Copy Markdown
Member

NFC

The workspace/symbol, workspace/symbolNames, workspace/symbolInfo and workspaceSymbol/resolve implementations made up roughly 470 lines of SourceKitLSPServer.swift. Move them to WorkspaceSymbols.swift and leave each request handler in SourceKitLSPServer.swift as a single statement that forwards to its implementation.

Fold QualifiedWorkspaceSymbolQuery.swift into the same file, since the query type and its fuzzy matching helper are only used by the qualified workspace/symbol search path.

Also remove languageClass(for:), whose last caller went away when language service instances became scoped per workspace.

@rintaro

rintaro commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@swift-ci Please test

The `workspace/symbol`, `workspace/symbolNames`, `workspace/symbolInfo`
and `workspaceSymbol/resolve` implementations made up roughly 470 lines
of SourceKitLSPServer.swift. Move them to WorkspaceSymbols.swift and
leave each request handler in SourceKitLSPServer.swift as a single
statement that forwards to its implementation.

Fold QualifiedWorkspaceSymbolQuery.swift into the same file, since the
query type and its fuzzy matching helper are only used by the qualified
`workspace/symbol` search path.

Also remove `languageClass(for:)`, whose last caller went away when
language service instances became scoped per workspace.
@rintaro
rintaro force-pushed the extract-workspace-symbols branch from c852db9 to 7828e2b Compare August 8, 2026 01:30
@rintaro

rintaro commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@swift-ci Please test

@rintaro

rintaro commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@swift-ci Please test Windows

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In other files (eg. Rename.swift and CodeCompletion.swift) we extend SourceKitLSPServer/SwiftLanguageService to add the request handler method that you left in SourceKitLSPServer. I don’t have a strong preference to either way of approaching request handles implemented in other files (I kind of like what you did) but I think we should be consistent with the approach taken.

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