Skip to content

Fix diagnostics not being shown for Swift packages in workspace subfolders#2173

Open
plemarquand wants to merge 11 commits into
swiftlang:mainfrom
plemarquand:add-subfolders-to-lsp-correctly
Open

Fix diagnostics not being shown for Swift packages in workspace subfolders#2173
plemarquand wants to merge 11 commits into
swiftlang:mainfrom
plemarquand:add-subfolders-to-lsp-correctly

Conversation

@plemarquand

@plemarquand plemarquand commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Description

Subfolders were not being registered as workspace folders with SourceKit-LSP unless a file from the sub folder was focused when the package was added. Consequently diagnostics requests may never have been produced for files in those packages.

Refactor LSP creation to add folders to the workspace as they are discovered. Hold back the initial LSP requests for a folder until the workspace/didChangeWorkspaceFolders response has been received, ensuring the LSP knows about a folder before receiving requests for it.

Also removes the legacy pre-5.7 single-server codepath that is no longer needed.

Issue: #2166

Tasks

  • Required tests have been written
  • Documentation has been updated
  • Added an entry to CHANGELOG.md if applicable

@plemarquand plemarquand force-pushed the add-subfolders-to-lsp-correctly branch from 22dde0a to e42af11 Compare March 31, 2026 20:42
@plemarquand plemarquand added the full-test-run Perform a full test suite run. Apply this label before pushing up a PR or commit label Mar 31, 2026
@plemarquand plemarquand force-pushed the add-subfolders-to-lsp-correctly branch from 206a1ba to e42af11 Compare April 1, 2026 18:00
plemarquand added 10 commits May 4, 2026 09:44
…lders

Subfolders were not being registered as workspace folders with
SourceKit-LSP unless a file from the sub folder was focused when
the package was added. Consequently diagnostics requests may never
have been produced for files in those packages. Ensure non-root
folders are added to subFolderWorkspaces and notified to the language
server on creation.

Also removes the legacy pre-5.7 single-server codepath that is no
longer needed.

Issue: swiftlang#2166
@plemarquand plemarquand force-pushed the add-subfolders-to-lsp-correctly branch from 7ba66c6 to e1f7604 Compare May 4, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-test-run Perform a full test suite run. Apply this label before pushing up a PR or commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants