swiftlang/sourcekit-lsp
52.0
Adequate · 30 September 2026
56.7k
lines of production code
Swift
primary language
2
measurements over time
What this system is
SourceKit-LSP is a language server for Swift and C that provides IDE features such as code completion, diagnostics, refactoring, and documentation previews. It manages background indexing and integrates with external build systems via the Build Server Protocol to keep semantic information up-to-date. The system includes a CLI for configuration and debugging, along with plugins to enhance code completion scoring and interaction with the underlying SourceKit infrastructure.
How it got here
2018 — Build system migration and legacy cleanup
22 changes.
The project introduced a CMake build system alongside Swift Package Manager and restructured the CLI with Swift ArgumentParser to improve developer workflows. This period involved removing the VS Code extension source and eliminating legacy modules for JSON-RPC handling, build system abstraction, and document management. Test infrastructure was modernized by replacing manual Linux manifests with automatic discovery and adding new assertion helpers.
2019–2024 — modularization and background indexing
23 changes.
This period focused on restructuring the codebase into distinct modules such as SourceKitD, SemanticIndex, and SKUtilities to improve organization and maintainability. It introduced core infrastructure for background indexing and enhanced diagnostic capabilities with new tools for crash reduction and debugging. The work also standardized build processes via CMake and consolidated configuration management into dedicated modules.
2025–2026 — Completion scoring and service modularization
21 changes.
This period focused on overhauling the code completion system by introducing a high-performance, semantically-aware scoring engine with binary serialization and parallel processing capabilities. Concurrently, the architecture was refactored by extracting language services and build server integration into dedicated modules to improve modularity and maintainability.
Features
Add C completion scoring library with Windows compatibility
A new C library named CCompletionScoring has been added to provide completion scoring functionality. The library includes a header file that defines a portable \sourcekitlsp\_memmem\ function, which implements a custom memory search routine for Windows environments where the standard \memmem\ is unavailable, while delegating to the system implementation on other platforms. The module is configured via CMake as an interface library and exposes its headers through a module map for Swift interoperability.
Sources/CCompletionScoring · high confidence
Add ConfigSchemaGen tool to generate SourceKit-LSP configuration documentation
A new \ConfigSchemaGen\ utility has been added to \SourceKitLSPDevUtils\ to automatically generate the JSON schema (\config.schema.json\) and Markdown documentation (\Documentation/Configuration File.md\) for the SourceKit-LSP configuration file format. The tool scans Swift type definitions in the \SKOptions\ module to produce a JSON Schema (draft-07) and a structured Markdown guide, ensuring that documentation stays in sync with the code. It includes a \verify\ command to check if generated files are up-to-date and a \generate\ command to update them, and it supports VS Code-specific features like \markdownDescription\ and \markdownEnumDescriptions\ for rich hover tooltips.
SourceKitLSPDevUtils/Sources/ConfigSchemaGen · high confidence
Add SourceKit client plugin for code completion
A new SourceKit client plugin has been added to handle code completion requests. This plugin initializes a connection to sourcekitd, registers custom buffer handlers for completion results, and ensures proper path resolution to avoid crashes when loading plugins from the same path.
Sources/SwiftSourceKitClientPlugin · high confidence
Add binary serialization utilities and low-level memory management helpers
This change introduces a new \BinaryCodable\ protocol and its associated \BinaryEncoder\ and \BinaryDecoder\ implementations within \Sources/CompletionScoring/Utilities/Serialization\, enabling efficient, versioned binary serialization for Swift types. It includes conformances for standard collections (\Array\, \Dictionary\, \String\, \Optional\, \OptionSet\) and primitive types (\Int\, \UInt\, \Float\, \Double\, \Bool\). Additionally, it adds low-level utility types such as \UnsafeArray\ and \UnsafeStackAllocator\ for manual memory management, and a \selectTopKAndTruncate\ method for efficient partial sorting of buffer pointers.
Sources/CompletionScoring/Utilities · high confidence
Added config schema generation and verification subcommands
The \sourcekit-lsp-dev-utils\ tool now includes two new subcommands: \generate-config-schema\, which produces the JSON schema and documentation for the SourceKit-LSP configuration file, and \verify-config-schema\, which checks that these generated artifacts are up-to-date.
SourceKitLSPDevUtils/Sources/SourceKitLSPDevUtils · high confidence
Deterministic test infrastructure for completion scoring
The CompletionScoringTestSupport module now provides a repeatable, deterministic environment for testing code-completion scoring. It introduces a RepeatableRandomNumberGenerator seeded from a bundled RandomSeed.plist, a SymbolGenerator that constructs realistic API signatures using a CommonFunctionTerms.json word list, and utilities for weighted random choices and timing statistics. This ensures that completion-scoring tests produce consistent, reproducible results across runs.
Sources/CompletionScoringTestSupport · high confidence
Introduce CMake build system and standardized development configuration
SourceKit-LSP now supports building via CMake (CMakeLists.txt) in addition to Swift Package Manager, enabling integration with CMake-based workflows and allowing consumers to link against SourceKit-LSP as a library. The project now includes a \.swift-format\ configuration to enforce consistent code style, a \.editorconfig\ for editor settings, and a \config.schema.json\ generated from source options to validate and document the \.sourcekit-lsp/config.json\ file. Development is streamlined with a \sourcekit-lsp.code-workspace\ file for VS Code, a \sourcekit-lsp-dev-utils\ script, and updated \CONTRIBUTING.md\ documentation covering Linux and Windows build requirements, testing, and debugging.
(repo-wide) · high confidence
Introduce SKUtilities library with Debouncer, LRUCache, and LineTable
A new SKUtilities library has been added to the build system (CMakeLists.txt), providing shared utility components for the language server. This includes a Debouncer actor for aggregating and delaying function calls, an LRUCache struct for managing key-value pairs with a fixed capacity, and a LineTable struct for efficient line-based text indexing and editing. These utilities are now available as a standalone static library linked with SwiftSyntax and logging dependencies.
Sources/SKUtilities · high confidence
Introduce SemanticIndex module for background indexing infrastructure
The \Sources/SemanticIndex\ module has been added to centralize the background indexing logic. It introduces \SemanticIndexManager\ to coordinate target preparation and index store updates, a \TaskScheduler\ to manage task execution and dependencies, and \CheckedIndex\ to verify index freshness. This change provides the core infrastructure for background indexing, allowing the editor to keep semantic information up-to-date as files are modified.
Sources/SemanticIndex · high confidence
Introduce SourceKitPluginCommon library for plugin-side SourceKitD access
A new static library, SourceKitPluginCommon, has been added to provide a shared foundation for SourceKit plugins. It exposes a \CompletionResultsArray\ type to safely parse and iterate over code completion results returned by sourcekitd, and provides a \SourceKitD.forPlugin\ singleton accessor. This accessor allows plugin code to retrieve the specific SourceKitD instance it was loaded with, ensuring plugins interact with the correct runtime context.
Sources/SwiftSourceKitPluginCommon · high confidence
Introduce TSCExtensions module with improved process management and cross-platform utilities
A new TSCExtensions module has been added to provide shared utilities and extensions. This includes a new Process.run method that automatically tracks the priority of the calling Swift task and ensures processes are cleanly terminated (SIGINT followed by SIGKILL after a timeout) if the task is cancelled. The module also introduces SwitchableProcessResultExitStatus for consistent, exhaustive switching over process exit statuses across platforms, an AbsolutePath initializer that returns nil on validation failure, and URL extensions for appending relative paths. Additionally, the ByteString utility has been migrated into this module with updated visibility.
Sources/TSCExtensions · high confidence
Introduce high-performance text completion scoring engine
Adds a new text-based completion scoring subsystem within \Sources/CompletionScoring/Text\ to improve the speed and relevance of code completion results. This change introduces a suite of new types including \Pattern\ for parsing user input, \RejectionFilter\ for fast, case-insensitive character presence checks, and \CandidateBatch\ for efficient, column-oriented storage of completion candidates. The system utilizes \ScoredMatchSelector\ to parallelize matching across processor cores and \MatchCollator\ to aggregate, rescore, and select the best matches using influencing identifiers and tie-breakers, replacing previous text-matching logic with a more optimized, unsafe-memory-aware implementation.
Sources/CompletionScoring/Text · high confidence
New BuildServerIntegration module for build server management
A new \BuildServerIntegration\ module has been added to SourceKit-LSP, introducing a centralized \BuildServerManager\ to coordinate communication with build servers. This change introduces \BuildServerHooks\ to allow injecting custom message handlers for testing or custom behavior, and a \BuildServerMessageDependencyTracker\ to manage concurrency and ordering of BSP requests and notifications. The module also includes \BuildSettingsLogger\ to deduplicate and format build setting logs, and \CompilationDatabase\ support for parsing \compile\_commands.json\ files, enabling the language server to better integrate with external build systems and improve background indexing performance.
Sources/BuildServerIntegration · high confidence
New SourceKit plugin for code completion
A new SourceKit plugin has been added to handle code completion requests, including opening, updating, and closing completion sessions, as well as fetching full documentation and diagnostics. This plugin introduces a new build target (SwiftSourceKitPlugin) with dedicated modules for request/response handling (SKDRequest/Response readers and builders) and completion logic (CompletionProvider, CompletionResultsArrayBuilder), and it is wired into the build system via CMakeLists.txt.
Sources/SwiftSourceKitPlugin · high confidence
New SourceKit-based code completion plugin implementation
This change introduces a new SourceKit plugin for handling code completion requests, replacing the previous implementation. The new plugin includes a complete set of data structures for completion items (including diagnostics, identifiers, item kinds, priority buckets, semantic context, and type relations), context handling, and sorting logic. It also adds a Connection class that manages document state and interacts with the SourceKitD API to perform completions, including support for request cancellation. The TextEdit structure has been simplified and moved from the LanguageServerProtocol module to this new plugin location.
Sources/SwiftSourceKitPlugin/CodeCompletion · high confidence
New SwiftExtensions module provides utility types and collection extensions
A new \SwiftExtensions\ module has been introduced, consolidating various utility functions and collection extensions previously scattered across other modules. This includes a new \Cache\ class for asynchronous result caching, \Array\ extensions for sorting and deduplication, and sequence helpers like \asyncMap\ and \partition(intoNumberOfBatches)\. The module also adds platform detection utilities, process termination helpers, and a \LazyValue\ type, while removing duplicate implementations of APIs already available in \swift-tools-protocols\.
Sources/SwiftExtensions · high confidence
New SwiftSyntaxExtensions library with syntax helper utilities
A new static library, SwiftSyntaxExtensions, has been added to the build system (CMakeLists.txt) containing SwiftSyntax extensions. These provide utilities for source analysis: checking if attributes are named with a specific module, identifying XCTest-style test functions (isXCTestFunction, isSyntacticXCTestMethod), computing fully qualified names for member access expressions, and detecting disabled Swift Testing traits.
Sources/SwiftSyntaxExtensions · high confidence
New build and utility scripts for SourceKit-LSP
This change introduces \Utilities/build-script-helper.py\, a Python 3 script that automates building and installing SourceKit-LSP. It handles platform-specific logic for rpath configuration (supporting Linux, macOS, FreeBSD, OpenBSD, and Android), cross-compilation, and sanitizer flags. Additionally, it adds \Utilities/generate-uids.py\ to automatically generate SourceKitD UIDs from the main Swift repository, and \Utilities/ubsan\_supressions.supp\ to suppress specific undefined behavior sanitizer warnings. The legacy \Utilities/swiftpm.sublime-build\ file is removed.
Utilities · high confidence
New sourcekit-lsp diagnose and debug subcommands for crash reduction
The \sourcekit-lsp diagnose\ command now automatically detects recent sourcekitd and swift-frontend crashes, reduces them to minimal reproducers, and bundles the results for reporting. A new \debug\ subcommand group exposes tools for developers to manually reduce specific sourcekitd requests (\debug reduce\), reduce swift-frontend crashes (\debug reduce-frontend\), run arbitrary sourcekitd requests (\debug run-sourcekitd-request\), index projects (\debug index\), and visualize concurrent requests via signpost traces (\debug trace-from-signposts\).
Sources/Diagnose · high confidence
New syntactic code actions for Swift refactoring
The SwiftSyntaxCodeActions module now provides a suite of new syntactic code actions to help refactor Swift code directly in the editor. Users can now add documentation templates to functions and macros, add explicit raw values to enums with Int, UInt, or String raw types, and format integer literals with underscores. Additional refactoring options include converting between boolean and bitwise De Morgan expressions, transforming comments into doc comments, converting computed properties to stored properties (and vice versa), converting zero-parameter computed properties to functions, and converting if-let statements with early exits to guard statements. The module also supports converting integer literals between different bases (binary, octal, decimal, hex), converting JSON literals into Codable structs, converting string concatenation to interpolation, swapping binary operands, removing redundant parentheses, and toggling test code.
Sources/SwiftSyntaxCodeActions · high confidence
New test infrastructure and assertion helpers in SKTestSupport
The SKTestSupport module has been significantly expanded with new utilities to improve test reliability and coverage. This includes a new \Assertions.swift\ file providing async-compatible assertion helpers like \assertNoThrow\, \assertThrowsError\, and \assertContains\, as well as a \fulfillmentOfOrThrow\ function for managing test expectations. New test project abstractions such as \MultiFileTestProject\, \IndexedSingleSwiftFileTestProject\, and \ExternalBuildServerTestProject\ allow for more flexible workspace setups, including support for custom build servers and single-file indexing. Additionally, infrastructure for handling plugin paths, finding tools across platforms, and managing test scratch directories has been added or refined.
Sources/SKTestSupport · high confidence
SourceKit-LSP now provides documentation previews for Swift, Markdown, and Tutorial files
The \DocumentationLanguageService\ module has been introduced to handle \textDocument/doccDocumentation\ requests, enabling users to view rendered documentation for Swift symbols, Markdown articles, and Tutorials directly within the editor. This change merges previous documentation handling logic into a dedicated service that coordinates with the build system to locate DocC catalogs and uses a local DocC server to convert symbol graphs and markup files into render nodes. It also includes a reference resolution service to resolve links within documentation content, ensuring that navigation and symbol lookups work correctly for documentation files.
Sources/DocumentationLanguageService · high confidence
Removals
Removal of legacy ClangLanguageServerShim wrapper
The \ClangLanguageServer.swift\ file, which contained the \ClangLanguageServerShim\ class and the \makeJSONRPCClangServer\ factory function, has been removed. This eliminates the previous thin wrapper that managed the connection to the clangd server and handled build setting forwarding via \BuildSettingsProvider\. Users relying on this specific internal implementation for clangd integration will see this component removed as part of the broader reorganization into bare LSP modules.
Sources/SourceKit/clangd · high confidence
Removal of legacy JSON-RPC connection and message handling code
The \JSONRPCConnection\ class, along with the \Message\, \MessageCoding\, and \MessageSplitting\ modules, has been removed from the \LanguageServerProtocolJSONRPC\ source directory. This deletion eliminates the previous synchronous, dispatch-queue-based implementation for handling JSON-RPC messages over file descriptors, indicating that the underlying communication mechanism has been replaced by a different architecture (likely the async/actor-based approach mentioned in commit history) in other parts of the system.
Sources/LanguageServerProtocolJSONRPC · high confidence
Removal of legacy SKCore build system and toolchain components
The \BuildSystem\, \CompilationDatabase\, \Toolchain\, and \ToolchainRegistry\ modules have been removed from \Sources/SKCore\. This change eliminates the previous implementation for loading compilation databases, providing fallback build settings, and managing toolchain discovery, indicating a shift away from these specific legacy mechanisms in favor of newer build-system abstractions.
Sources/SKCore · high confidence
Removal of legacy SwiftPM workspace implementation
The \SwiftPMWorkspace.swift\ file has been deleted from the \Sources/SKSwiftPMWorkspace\ module. This removes the previous implementation of the Swift Package Manager workspace integration, which is no longer part of the codebase.
Sources/SKSwiftPMWorkspace · high confidence
Removal of the VS Code extension source code
The source code for the SourceKit-LSP Visual Studio Code extension has been completely removed from this repository. This includes the main extension entry point, build configuration files (tsconfig.json, tasks.json, settings.json), development launch configurations, and documentation (README.md). Users can no longer build or install this extension from this location.
Editors/vscode · high confidence
Removed legacy SKSupport utility modules
The \Int.swift\, \LineTable.swift\, \Logging.swift\, and \dlopen.swift\ files have been removed from the \Sources/SKSupport\ module. This eliminates legacy implementations for ASCII integer parsing, line-table management, logging infrastructure, and dynamic library loading, indicating that these capabilities are no longer maintained or required in this location.
Sources/SKSupport · high confidence
Removed legacy SourceKit document and server management components
The \DocumentManager\, \SourceKitServer\, and \Workspace\ classes have been removed from the \Sources/SourceKit\ module. This deletion eliminates the previous document lifecycle management, server initialization, and workspace configuration logic, reflecting a structural reorganization of the repository into bare LSP and SourceKit modules.
Sources/SourceKit · high confidence
Removed legacy Swift language server implementation
The \SwiftLanguageServer\ and \SwiftSourceKitFramework\ classes have been removed from the \Sources/SourceKit/sourcekitd\ directory. This deletes the previous implementation that managed the \sourcekitd\ dylib directly via \dlopen\ and handled LSP requests (such as diagnostics, completion, and hover) within this specific module. Users relying on this specific internal server structure will need to migrate to the new modular LSP architecture.
Sources/SourceKit/sourcekitd · high confidence
Architecture
ClangLanguageService extracted into its own module
The ClangLanguageService implementation has been moved from the main SourceKitLSP module into a dedicated ClangLanguageService module. This refactoring isolates the clangd integration logic, including the ClangLanguageService actor and the SemanticTokenTranslator, into a separate build target with its own dependencies, improving modularity and build organization.
Sources/ClangLanguageService · high confidence
SourceKitD is extracted into a standalone module with a new registry and request/response types
The SourceKitD component is now a distinct module (\Sources/SourceKitD\) that encapsulates the low-level communication with the \sourcekitd\ dylib. This change introduces a \SourceKitDRegistry\ actor to manage and deduplicate \sourcekitd\ instances by their library path, ensuring a single connection per library. It also provides new Swift types (\SKDRequestArray\, \SKDRequestDictionary\, \SKDResponse\, etc.) for constructing requests and parsing responses, along with a \SourceKitDCore\ protocol to abstract the dynamic library loading and lifecycle management.
Sources/SourceKitD · high confidence
Behavioural changes
In-process client now supports explicit request IDs and cancellation
The \InProcessSourceKitLSPClient\ has been updated to allow callers to specify a custom \RequestID\ when sending requests, enabling precise tracking and correlation of LSP messages. Additionally, the client now supports cancellation of in-flight requests via the \CancelRequestNotification\, improving responsiveness when operations are no longer needed.
Sources/InProcessClient · high confidence
Introduce SourceKit plugin-based code completion with enhanced scoring and documentation
The code completion system in the Swift SourceKit plugin has been replaced with a new implementation that leverages the SourceKit IDE API for retrieving completion results. This change enables the inclusion of full documentation in code completion items and introduces a more sophisticated scoring mechanism that considers semantic classification factors such as symbol availability, module proximity, and popularity. Users will see improved relevance and richer context in their code completion suggestions, particularly for symbols defined in external modules.
Sources/SwiftSourceKitPlugin/ASTCompletion · high confidence
Introduce dedicated ToolchainRegistry module for toolchain discovery and management
This change extracts toolchain-related logic into a new \ToolchainRegistry\ module, providing a centralized registry for discovering, caching, and prioritizing toolchains. The registry now supports explicit toolchain selection via the \SOURCEKIT\_TOOLCHAIN\_PATH\ environment variable, prefers \.dylib\ SourceKit plugins over \.framework\ bundles, and caches the mapping from compiler paths to their owning toolchain to improve lookup performance. It also standardizes file path handling and ensures the environment-variable-specified toolchain is always returned as the preferred option.
Sources/ToolchainRegistry · high confidence
Introduce semantic scoring components for code completions
The completion scoring system now incorporates semantic signals to refine result ranking. New types in the \Sources/CompletionScoring/Semantics\ module define scoring components for availability, completion kind, module and scope proximity, structural proximity, type and synchronicity compatibility, and contextual flair. A \PopularityIndex\ allows popularity bonuses to be applied based on symbol and module reference frequencies, while \CompletionScore\ combines these semantic components with textual scores to produce a final ranking value.
Sources/CompletionScoring/Semantics · high confidence
Introduction of CMake build system and Swift 6 compilation mode
The project now supports building via CMake, as evidenced by the new Sources/CMakeLists.txt file which defines the build structure for all source modules. This configuration explicitly enables Swift 6 language mode and sets the package name to 'sourcekit\_lsp', ensuring compatibility with the latest Swift toolchain standards. Additionally, symbolic links are created to support plugin-specific build requirements.
Sources · high confidence
Linux static destructor registration suppressed in test support
The CSKTestSupport library now overrides \\_\_cxa\_atexit\ on Linux to prevent the registration of static destructors. This change addresses issue SR-12668 (referenced in commit messages) and GitHub issue \#55112, ensuring that test execution does not trigger unwanted static cleanup behavior on Linux platforms. A module map is also added to properly expose the CSKTestSupport module.
Sources/CSKTestSupport · high confidence
New LanguageServerProtocolExtensions module for SourceKit-LSP utilities
SourceKit-LSP now includes a new \LanguageServerProtocolExtensions\ library that consolidates several helper utilities previously scattered across the codebase. This module provides a \WorkDoneProgressManager\ actor to handle progress reporting to language clients, extensions for inferring programming languages from file URIs, a convenience initializer for converting various error types into LSP \ResponseError\ objects, and a utility to resolve symlink targets in document URIs. These changes streamline internal protocol handling and improve how the server communicates status and errors to the editor.
Sources/LanguageServerProtocolExtensions · high confidence
New documentation for SourceKit-LSP configuration and features
SourceKit-LSP now includes comprehensive documentation for its configuration file, explaining how to use \.sourcekit-lsp/config.json\ to customize behavior such as SwiftPM options, logging levels, and background indexing. The release also introduces guides for enabling extended logging on macOS and non-Apple platforms, details on using SourceKit-LSP with embedded projects, and a complete reference of available refactoring actions. Additionally, editor integration instructions have been updated to include support for Nova and JetBrains IDEs via the Noctule extension.
Documentation · high confidence
Refactor jump-to-definition to use a unified DefinitionLocations module
Jump-to-definition lookups are now handled by a new \DefinitionLocations\ module that consolidates logic for resolving symbol locations. This change introduces a fallback mechanism: if a symbol is not found in the semantic index, the system now attempts to generate and jump to the textual Swift interface for the module. This ensures that definition navigation works reliably for third-party binary frameworks or libraries where index data might be missing.
Sources/SourceKitLSP · high confidence
Removal of legacy LanguageServerProtocol module files
The \LanguageServerProtocol\ module has removed a large set of legacy source files, including \ClientCapabilities.swift\, \ServerCapabilities.swift\, \Connection.swift\, \LanguageServer.swift\, \Message.swift\, \Messages.swift\, \Request.swift\, \Diagnostic.swift\, \Error.swift\, \Language.swift\, \CompletionItem.swift\, \CompletionItemKind.swift\, \CodeActionKind.swift\, \Position.swift\, \RequestID.swift\, and \MessageRegistry.swift\. This cleanup eliminates the previous internal connection and message-handling abstractions, as well as older capability and message type definitions, in preparation for the module to become dependency-free and align with upstream LSP specifications.
Sources/LanguageServerProtocol · high confidence
Renamed SourceKit-D API and added code completion interop headers
The C source headers in Sources/Csourcekitd/include have been refactored to rename the public API prefix from sourcekitd\_ to sourcekitd\api\ (e.g., sourcekitd\_functions\_t becomes sourcekitd\_api\_functions\_t) and added nullability annotations to improve Swift interop safety. Additionally, two new headers, CodeCompletionSwiftInterop.h and plugin.h, were introduced to expose the SwiftIDE code completion API and plugin initialization interfaces, and the module map was updated to export these new headers alongside the existing sourcekitd\_functions.h.
Sources/Csourcekitd/include · high confidence
SourceKit-LSP configuration options are consolidated into the new SKOptions module
SourceKit-LSP's configuration capabilities have been reorganized into a dedicated \SKOptions\ module, centralizing how users control the language server's behavior. This change introduces explicit configuration options for SwiftPM, allowing users to specify build configurations (debug/release), custom SDKs, toolsets, compiler flags, and sandbox settings via the configuration file. It also adds support for selecting the build system type (native vs. swiftbuild) and workspace type (build server, compilation database, or SwiftPM). Additionally, users can now control target preparation batching strategies and enable experimental features such as on-type formatting and structured logging through dedicated configuration flags.
Sources/SKOptions · high confidence
SwiftLanguageService moved to a dedicated module with improved code completion and diagnostics
The SwiftLanguageService implementation has been extracted into its own module, bringing with it a suite of behavioral improvements for the user. Code completion now better handles positions inside or immediately after identifiers and correctly detects following call contexts (such as empty parentheses or trailing closures) to provide more accurate suggestions. Diagnostics are now more robust, with missing-import quick fixes attached directly to unresolved-symbol diagnostics and fallback syntactic diagnostics provided via swift-syntax when build settings are unavailable. Additionally, document formatting now respects local .swift-format configuration files, and new utilities adjust cursor positions to the start of arguments or identifiers to ensure consistent navigation behavior.
Sources/SwiftLanguageService · high confidence
sourcekit-lsp CLI restructured with new configuration and subcommands
The sourcekit-lsp command-line interface has been restructured to use Swift ArgumentParser, introducing a new \--configuration\ flag for build settings, \--build-path\ (replacing the deprecated \--scratch-path\), and flags to pass compiler/linker options to C, C++, Swift, and clangd (\-Xcc\, \-Xcxx\, \-Xlinker\, \-Xswiftc\, \-Xclangd\). It now supports per-workspace configuration via \.sourcekit-lsp\ config files and environment variables, allows specifying index prefix mappings (\--index-prefix-map\), and enables experimental features via \--experimental-feature\. The CLI also adds \diagnose\ and \debug\ subcommands for crash reduction and development tasks, replacing the previous monolithic entry point.
Sources/sourcekit-lsp · high confidence
Test coverage
Added Python test support for BSP server simulation; Added comprehensive test suite for Build Server integration; Added performance tests for completion scoring and candidate batching; Added test coverage for SKUtilities and SwiftExtensions; Added test coverage for call hierarchy, code lens, closure completion formatting, and crash recovery; Added test suite for CompletionScoring module; Added tests for SourceKit plugin code completion and test infrastructure; Added tests for SourceKitD registry and notification handling; Added tests for SwiftSyntax code actions; Added tests for TaskScheduler priority and dependency handling; Added tests for ToolchainRegistry; Added tests for the sourcekit-lsp diagnose reducer; Automated test discovery on Linux replaces manual manifest; Remove legacy XCTest manifest and performance test files; Remove obsolete SourceKit test files and Linux test manifests; Remove obsolete XCTest manifests and test files; Removed legacy XCTest manifest and test file for SKSupport; Removed legacy test files and Linux test manifests.
Dependencies
Added CMake build configuration for Csourcekitd
A CMakeLists.txt file has been added to the Sources/Csourcekitd directory, defining a static library target named Csourcekitd built from sourcekitd.c and exposing the include directory. This change introduces CMake as a build system for this specific component, alongside the addition of standard Apache 2.0 license headers to the source file.
Sources/Csourcekitd · high confidence
Major dependency and build system overhaul
The project has undergone a significant infrastructure update: the Swift package manifest has been upgraded to Swift tools version 6.3, requiring a Swift 6 compiler and macOS 15, while the VS Code extension's legacy \package.json\ and \package-lock.json\ files have been removed. Additionally, a new \SourceKitLSPDevUtils\ package has been introduced to provide development utilities, including a \sourcekit-lsp-dev-utils\ executable and schema generation tools, relying on \swift-argument-parser\ 1.5.0 and \swift-syntax\ 600.0.1.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 57 → 52 (-4.8)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 88 → 87 (-0.7)
- Architecture 93 → 89 (-4.7)
- Maturity 63 → 63 (-0.0)
- Readiness 32 → 31 (-1.2)
- Security 100 → 100 (+0.0)
- Performance 64 (new)
Resolved (10)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Hotspot: Sources/BuildServerIntegration/BuildServerManager.swift (Sources/BuildServerIntegration/BuildServerManager.swift)
- Hotspot: Sources/BuildServerIntegration/SwiftPMBuildServer.swift (Sources/BuildServerIntegration/SwiftPMBuildServer.swift)
- Hotspot: Sources/SemanticIndex/SemanticIndexManager.swift (Sources/SemanticIndex/SemanticIndexManager.swift)
- Hotspot: Sources/SemanticIndex/TaskScheduler.swift (Sources/SemanticIndex/TaskScheduler.swift)
- Hotspot: Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift (Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift)
- Off-boarding risk: anonymized user #1
- Off-boarding risk: anonymized user #2
- Off-boarding risk: anonymized user #3
New (41)
- Coverage not measured — Swift suite
- DefinitionLocations.swift.definitionLocations (cognitive 16) (Sources/SourceKitLSP/DefinitionLocations.swift)
- Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
- Diagnostic.init (cognitive 38) (Sources/SwiftLanguageService/Diagnostic.swift)
- Diagnostic.init (cyclomatic 33) (Sources/SwiftLanguageService/Diagnostic.swift)
- Duplicated block (11 lines × 2) (Sources/BuildServerIntegration/BuildTargetIdentifierExtensions.swift)
- Duplicated block (12–13 lines × 4) (Sources/SourceKitD/sourcekitd_functions.swift)
- Duplicated block (13 lines × 2) (Sources/SKTestSupport/PluginPaths.swift)
- Duplicated block (22 lines × 2) (Sources/BuildServerIntegration/BuildServerManager.swift)
- Duplicated block (5 lines × 2) (Sources/BuildServerIntegration/BuildServerManager.swift)
- Duplicated block (5 lines × 2) (Sources/CompletionScoring/Utilities/SwiftExtensions.swift)
- Duplicated block (5 lines × 2) (Sources/SwiftSourceKitClientPlugin/ClientPlugin.swift)
- Duplicated block (5 lines × 4) (Sources/SourceKitD/SKDRequestArray.swift)
- Duplicated block (6 lines × 2) (Sources/Diagnose/ReduceCommand.swift)
- Duplicated block (8 lines × 2) (Sources/SKTestSupport/CheckCoding.swift)
- Duplicated block (9 lines × 2) (Sources/SourceKitD/SKDResponseArray.swift)
- Low cohesion: Array (LCOM4 6) (Sources/Diagnose/CommandLineArgumentsReducer.swift)
- Low cohesion: Collection (LCOM4 6) (Sources/SemanticIndex/TaskScheduler.swift)
- Low cohesion: Sequence (LCOM4 9) (Sources/SourceKitLSP/SourceKitLSPServer.swift)
- Low cohesion: String (LCOM4 9) (Sources/BuildServerIntegration/CompilationDatabase.swift)
- …and 21 more
Changes since last survey
- 3 commits — 3 feature/other, 0 fixes
By area
- (repo) — 2 commits
- Sources/SwiftLanguageService — 1 commit
Notable commits
- change: CodeCompletion: carry sourcekitd's semanticScore in code completion results
- change: Merge pull request #2763 from toyeshhm/fix-doc-typos
- change: Merge pull request #2773 from nkcsgexi/186169219
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
swiftlang/sourcekit-lsp was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 045c18e9e9ea35b896857b6cb982aa2373fb5816 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.