Commit Graph

147 Commits

Author SHA1 Message Date
Rintaro Ishizaki 77f474de45 Move Open Quickly and Jump to Definition docs to Contributor Documentation 2026-05-13 10:22:16 -07:00
Rintaro Ishizaki 223a88cb8c Add workspace/symbolNames and workspace/symbolInfo LSP extensions (#2619)
- **`sourcekit/workspace/symbolNames`** — returns a flat, deduplicated
list of every symbol name in the workspace index (source and indexed
system modules). Clients use this to drive their search UI locally.

- **`sourcekit/workspace/symbolInfo`** — given a list of exact symbol
names, returns `WorkspaceSymbolItem` for each occurrence across all
workspaces, for display in the search result list. Source-file symbols
get `SymbolInformation` with a `file://` location. SDK/stdlib symbols
get a `WorkspaceSymbol` with `location: .uri(…)` The client must call
`workspaceSymbol/resolve` after the user selects an SDK/stdlib symbol to
obtain the concrete interface location.

- **`workspaceSymbol/resolve`** — resolves the deferred
`WorkspaceSymbol` location from `sourcekit/workspace/symbolInfo`. Parses
the `?module=` value into `moduleName`/`groupName`, finds a real source
file via `mainFiles(containing:)`, calls `openGeneratedInterface`, and
returns the symbol with `location` replaced by a full
`sourcekit-lsp://generated-swift-interface/` URI + range (or a temp
`file://` path for clients without `workspace/getReferenceDocument`
support).
2026-05-12 22:21:17 -07:00
Gabe Braden 61eb1d6aad Added forceResolvedVersions option 2026-04-17 16:57:51 -04:00
Rintaro Ishizaki df14928358 Merge pull request #2553 from Tabonx/convert-comment-to-doc-comment
Add ConvertCommentToDocComment refactoring action
2026-03-31 09:53:26 -07:00
Alex Hoppen d803a4b757 Add SourceKit-LSP configuration option to pass --sdk to the SwiftPMBuildServer 2026-03-23 11:34:28 +01:00
Pavel Kroupa 394bc3e19e Merge branch 'main' into convert-comment-to-doc-comment
# Conflicts:
#	Tests/SourceKitLSPTests/CodeActionTests.swift
2026-03-21 21:30:43 +01:00
Pavel Kroupa a58a89c31b Add ConvertCommentToDocComment refactoring action 2026-03-15 20:32:54 +01:00
Alex Hoppen d13471cc74 Merge pull request #2485 from Steffeeen/semantic-tokens
Only create semantic tokens in cases where they are actually needed
2026-03-15 13:33:15 +01:00
Steffeeen dc2da5cc58 Add reportSyntacticHighlightInSemanticTokens config option
When this option is set to `true` the results for
`textDocument/semanticTokens` include semantic tokens for syntactic
highlighting obtained from swift-syntax. If this option is set to
`false` only the semantic tokens obtained from SourceKit are included.
This option defaults to `false`.
2026-03-13 17:02:47 +01:00
Karan 7435345133 Add RemoveRedundantParentheses refactoring action
Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-02-23 01:07:05 +05:30
Alex Hoppen eab73dce3c Merge pull request #2470 from noctule-ide/jansorg-noctule 2026-02-21 17:57:20 +01:00
Joachim Ansorg dcdb9e01cf Document Noctule integration for JetBrains IDEs
Added information about Noctule for JetBrains IDEs and its configuration.
Noctule is currently the only plugin for JetBrains IDEs, which is supporting cross-platform Swift support and support for Swift PM.

Noctule is a closed-source extension. It's currently offering all features for free, but will become freemium or paid software in the future.

It's okay if you don't want to mention Noctule because it's closed-source or commercial.
2026-02-17 16:27:39 +01:00
Alex Hoppen c7a2dca6aa Clarify that editors listed in the Editor Integration document should be free of charge 2026-02-08 16:39:11 +01:00
Karan Lokchandani 55d75954e5 Add if let to guard transform (#2420)
fixes: https://github.com/swiftlang/sourcekit-lsp/issues/1569

mostly works but not sure what to do with many edge cases and has a todo
for switch statements, also this will probably have conflicts with
https://github.com/swiftlang/sourcekit-lsp/pull/2406 marking as draft
till that merges and i can resolve the conflicts.


https://github.com/user-attachments/assets/a6d07f9d-6f09-4330-8cd0-2d24bd6973fb

---------

Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-13 22:46:54 +01:00
Alex Hoppen 852b6ed7de Merge pull request #2414 from loveucifer/some-doc-stuff
Add documentation for refactoring actions
2026-01-07 08:11:33 +01:00
loveucifer b60119a7bb updated docs 2026-01-06 17:57:31 +05:30
loveucifer 30a1245bb9 more docs 2026-01-06 06:57:32 +05:30
loveucifer 222cd51837 Add complete list of sourcekitd refactorings, remove Xcode from editor list 2026-01-05 18:38:22 +05:30
loveucifer afddc2ba62 Update Documentation/Refactoring Actions.md
Co-authored-by: Alex Hoppen <alex@alexhoppen.de>
2026-01-05 18:33:40 +05:30
loveucifer 8eeb7959f9 Add documentation for refactoring actions 2026-01-04 10:32:49 +05:30
Owen Voorhees 260b4df07a Allow opting in to using the new SwiftPM BSP when opening a package 2025-12-10 13:17:25 -08:00
Josh Arnold 668aab32ac Support custom preparationBatchSize defined via SourceKit's options 2025-12-03 13:37:25 -06:00
Alex Hoppen 65d84ffd72 Add comment that SourceKit-LSP needs to be restarted when configuration file is modified
Motivated by https://forums.swift.org/t/is-a-restart-needed-after-a-change-to-config-json/83022
2025-11-05 08:52:18 +01:00
Alex Hoppen c142b601ff Add a timeout for workspace/buildTargets and buildTarget/sources requests
This allows us to provide functionality based on fallback settings for unresponsive BSP servers.

Fixes #2252
2025-09-01 16:12:41 +02:00
Alex Hoppen 7f4f92e5bd Rename build system to build server in most cases
The term *build system* predated our wide-spread adoption of BSP for communicating between SourceKit-LSP to the build system and was never really the correct term anyway – ie. a `JSONCompilationDatabaseBuildSystem` never really sounded right. We now have a correct term for the communication layer between SourceKit-LSP: A build server. Rename most occurrences of *build system* to *build server* to reflect this. There are unfortunately a couple lingering instances of *build system* that we can’t change, most notably: `fallbackBuildSystem` in the config file, the `workspace/waitForBuildSystemUpdates` BSP extension request and the `synchronize-for-build-system-updates` experimental feature.
2025-08-02 08:45:01 +02:00
Alex Hoppen 14cfd50582 If sourcekitd or clangd don’t respond to a request for 5 minutes, terminate them and use crash recovery to restore behavior
This should be a last stop-gap measure in case sourcekitd or clangd get stuck, don’t respond to any requests anymore and don’t honor cancellation either. In that case we can restore SourceKit-LSP behavior by killing them and using the crash recovery logic to restore functionality.

rdar://149492159
2025-05-07 13:43:28 +02:00
ttozzi 9e973298b7 Gardening documents 2025-03-20 02:02:23 +09:00
Alex Hoppen 5fba1699bd Generalize PollIndexRequest and BarrierRequest into a single SynchronizeRequest
This new request also allows us to wait for build system updates without waiting for background indexing to finish.
2025-03-12 14:25:50 -07:00
Alex Hoppen cde206c017 Allow specifying toolsets for SwiftPM projects
Equivalent to SwiftPM’s `--toolset` option, implemented in https://github.com/swiftlang/swift-package-manager/pull/8051.

Fixes #2047
rdar://146557424
2025-03-11 13:21:54 -07:00
Alex Hoppen 8aa8fa0ff8 Remove offensive terms from the codebase 2025-03-07 13:58:02 -08:00
Alex Hoppen 2a1fd10295 Add an experimental LSP request to return the output paths for all files in a target 2025-03-06 08:30:47 -08:00
Alex Hoppen 655a93f05a Add structure to the index logs
When the client supports it, communicate the structure of tasks that were stared during background indexing or by the build server to the client. If there are multiple operations happening in parallel, this allows the client to display them in separate log tracks instead of interspersing them with the emoji prefixes like we do today.
2025-03-04 16:36:26 -08:00
Alex Hoppen 6a5195bc43 Move documentation on how to enable extended logging to its own document
I reference it too often to have it buried in `Diagnose Bundle.md`. Also ask for extended logging in the issue template if the originator is comfortable sharing it.
2025-02-28 16:16:16 -08:00
Alex Hoppen 6a1d923f5b Add a request to check if SourceKit-LSP is currently performing any indexing 2025-02-27 12:52:28 -08:00
Alex Hoppen f4e015b3c0 Merge pull request #1988 from ahoppen/sourcekitoptions
Add an experimental request to return the build settings that SourceKit-LSP uses to process a file
2025-02-26 16:06:20 -08:00
Alex Hoppen 9496b49c72 Add an experimental request to return the build settings that SourceKit-LSP uses to process a file
This can be useful to IDEs that want to perform some additional semantic processing of source files, which requires knowledge of a file’s build settings.
2025-02-26 09:12:47 -08:00
Alex Hoppen 628ce3cc63 If a build server doesn’t specify -index-store-path in the SourceKit options, add it during background indexing 2025-02-25 22:46:32 -08:00
Alex Hoppen f1aeb6c196 Add an experimental request to pause background indexing
This request allows IDEs to disable SourceKit-LSP’s background indexing functionality when it requires all compute resources for other, more interactive, tasks.
2025-02-21 08:09:34 -08:00
Ben Barham cea30e54b0 Add a couple missing SwiftPM options 2025-02-17 19:11:30 -08:00
Alex Hoppen 4ec669f834 Hide internal options from SourceKit-LSP configuration file documentation 2025-02-17 13:09:05 -08:00
Alex Hoppen 8787787e4f Allow loading the SourceKit plugin from the toolchain during testing 2025-01-27 09:18:45 -08:00
Ben Barham 84f7931d82 Re-generate the configuration file documentation
The verification for this was only merged after the plugin changes.
2025-01-15 21:25:55 -08:00
Alex Hoppen 69121eed95 Merge pull request #1906 from ahoppen/add-sourcekit-plugin
Add a SourceKit plugin to handle code completion requests
2025-01-15 12:42:18 -08:00
Alex Hoppen 16f897aefa Make the SourceKit plugins work on Windows 2025-01-11 06:57:03 +01:00
Alex Hoppen 5330795404 Add option to generate an output mirror file that contains the exact data sent from SourceKit-LSP to the client
This could help us debug low-level issues of SourceKit-LSP to client communication such as https://github.com/swiftlang/sourcekit-lsp/issues/1890.
2025-01-02 19:12:50 +01:00
Yuta Saito 90dc733542 Keep the original order of privacyLevel enum cases 2024-12-09 02:12:19 +09:00
Yuta Saito 7597945e38 Use an enum for backgroundPreparationMode in the configuration file instead of a string 2024-12-09 02:12:12 +09:00
Yuta Saito 96b582c189 Remove duplicate possible values from defaultWorkspaceType 2024-12-08 15:03:45 +09:00
Yuta Saito cbf04eafaf Replace newlines with spaces in property descriptions 2024-12-08 14:53:53 +09:00
Yuta Saito 227083654f Add missing periods to doc comment sentences for SourceKitLSPOptions 2024-12-08 14:19:22 +09:00