Open-source project
swiftlang/sourcekit-lsp avatar
swiftlang/sourcekit-lsp

SourceKit-LSP ships inside the toolchain, tags Swift releases, and never indexes in the background

Language Server Protocol implementation for Swift and C-based languages

3,929 stars412 forksSwiftApache-2.0

At a glance

What is it?
SourceKit-LSP is the language server for Swift and the C-based languages, distributed as part of the Swift toolchain rather than as a separate package. What the page is unusually clear about is the thing it does not do: update its index, or build your Swift modules, in the background.
Who is it for?
The server fits a Swift developer whose editor already speaks the protocol and who wants completion and navigation backed by the compiler's own machinery rather than by a separate indexer. It does not fit a large monorepo that has not been built recently, or an embedded project that passes extra arguments to its build.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • swiftlang/sourcekit-lsp3,929 ★ · +17
Star history
Repository2026-09-242026-11-15
swiftlang/sourcekit-lsp3.9k3.9k

17 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The release tags are Swift toolchain releases, so there is no server version to pin

The three most recent releases are named after Swift itself. One is the Swift 6.4.0 release from 2026-09-15. Before it, the 6.1.1 release from 2025-05-24 and the 6.1 release from 2025-04-01.

So the repository is versioned as part of the Swift release train rather than on its own schedule. A team that wants a reproducible editor experience cannot pin a server version; it has to pin a toolchain, and the server arrives with whatever that toolchain contains.

That is a defensible arrangement for a server whose value comes from being the same code that compiles the project, and it has one practical consequence that the page does not spell out: two developers on two toolchains can see different completion and navigation behaviour with the same editor settings, and the difference is not something they configured.

The last push to main is dated 2026-10-02, seventeen days after the newest release, so the branch is ahead of every tag.

There is nothing to install, because the server ships with the toolchain

The getting-started section is four sentences and no commands.

It says the server is included in the Swift toolchains available from the language's own download page, and that it is bundled with Xcode. There is no build step, no package manager entry and no binary to fetch from this repository's releases.

That makes the install question different from most language servers on this site, and it makes the second sentence the useful one: a list of popular editors that support the protocol lives on the tools page, together with set-up guides for hooking the server up to each one.

So the installation work is entirely in the editor. This repository supplies a server that is already present, and the documentation supplies the list of editors that can talk to it.

The repository does contain a Swift package manifest and a CMake file, so the tree can be built, but the page does not tell anyone to do that and the released artefact is the one inside the toolchain.

The index is not updated in the background, and that is the limitation that matters

There is one warning block on the page, and it is about behaviour rather than about installation.

It says the server does not update its global index in the background, and does not build Swift modules in the background. The consequence is stated next: a lot of cross-module or global functionality is limited if the project has not been built recently.

That is a real constraint rather than a caveat. Without a recent build there is no module interface information to resolve against, so completion across module boundaries, navigation into another module, and anything that needs the whole program's shape all get thinner. On a small package the effect is invisible; on a repository with hundreds of targets it is the first thing a new user complains about.

There are two remedies and the page gives both. Build the project, which is the honest one and the reason CI machines that build before serving an editor behave better. Or turn on the experimental background indexing, which is described in its own document under the documentation directory.

The word experimental is the project's own, and it is the only caveat in the block.

Embedded Swift projects need the build arguments declared separately

A second note covers a narrower case, and it is the kind of problem that costs an afternoon.

If you are using the server with a Swift package project where you have to pass additional arguments to the build invocation, which the page says is commonly the case for embedded projects, then you have to teach the server about those arguments yourself. The page does not explain how; it points at a second document in the same directory.

Embedded projects are the case where those arguments exist because the target is not the host machine, so the build needs cross-compilation settings, a triple, a sysroot. A server that invokes the build for you and does not know about them will either fail the invocation or produce module information for the wrong platform, and neither failure looks like a language server bug.

So there are two configuration problems in this page rather than one: build the project, and tell the server how you build it. Both are handled in separate documents under the documentation directory, neither is in the readme, and neither is a flag you can discover by reading the editor integration.

Two development utility directories whose names differ only by case

The repository root holds two entries that cannot coexist on a case-insensitive file system.

One is a directory whose name starts with capitals and ends in a camel-cased word. The other is a file with no extension, hyphenated and all lower case. Both are development utilities, they are adjacent in the alphabetical listing, and they are one capital letter apart.

On macOS, which is the platform most Swift developers and all Xcode users are on, and on any default case-insensitive volume, checking out this repository puts one of them on top of the other. Which one wins depends on the order the tree is written, and the losing entry is the kind of thing that shows up much later as a missing helper.

It is a small finding in isolation, and it is the sort of thing that survives in a repository for years because nobody on a case-sensitive file system ever notices. The fix is a rename, and the check is a single-line lint rule that most projects of this size do not have.

Both entries sit next to the source, test and utilities directories, so they are part of the working tree rather than something generated by a build.

Four configuration-enforcement files, one of them for a language the project is not written in

The root carries a formatter configuration, an editor configuration file, a licence header template, and a file listing which paths the licence header check ignores.

That is a deliberate setup: a formatter for the source language, an editor configuration so the formatter and the editor agree on indentation, and a licence header mechanism that keeps headers in place while exempting the paths where they do not apply. Four files that exist to make contributors produce the same bytes.

The odd one is a Python linter configuration, in a repository whose source is Swift and whose build is a Swift package manifest plus a CMake file. There is Python in the tree: the development utilities and the tooling around them. So the file is not a mistake, but it does mean one of the four enforcement mechanisms applies to a language a Swift contributor will never open a file in.

Which is also why the formatting rules are split in two rather than one. A repository with two languages and one formatter is a repository where the Python gets formatted by hand.

Two build systems, a config schema, and a documentation directory with a space in its name

The build side has two entry points side by side. One is the Swift package manifest, which is how a Swift project is built and tested. The other is a CMake file with its own module directory, which is how a C-based project in the same tree is built.

That pairing is the point of the project rather than an accident: it serves Swift and C-based languages from one server, and a repository that builds both needs both build systems. The page mentions CMake only as an example of a project that generates a compilation database, so the CMake file in this tree is for something else.

Three other root entries are worth naming. There is a JSON schema for the configuration file, which is what lets an editor validate a setting before the server rejects it. There is a workspace file for the editor, next to a dev container directory that gives contributors a working environment. And the contributor documentation lives in a directory whose name contains a space, which is legal in every tool here and unusual enough to be worth noticing.

Issue reporting goes through a chooser rather than a blank form, so the repository has templates for whoever is reporting something.

Editorial conclusion

The server fits a Swift developer whose editor already speaks the protocol and who wants completion and navigation backed by the compiler's own machinery rather than by a separate indexer. It does not fit a large monorepo that has not been built recently, or an embedded project that passes extra arguments to its build. Three things to check before you point an editor at it. Whether you have built the project since your last edit, because cross-module features degrade without that. Whether your SwiftPM project needs arguments on the build command line, because they have to be declared separately. And whether you want the experimental background indexing, since that is the documented alternative to building first.

Frequently asked questions

what is sourcekit lsp

An implementation of the Language Server Protocol for Swift and C-based languages, giving completion and jump-to-definition to editors that speak the protocol. It is built on the SourceKit library and on clangd for high-fidelity support, and it adds a source code index and cross-language support. It supports Swift Package Manager projects and projects that generate a compile_commands.json file.

how to install sourcekit lsp

You do not install it from this repository. The page says it is included in the Swift toolchains available from swift.org and is bundled with Xcode, and it points to the tools page for a list of popular editors that support the protocol along with their set-up guides.

how to use sourcekit lsp

Point an editor that supports the protocol at the server inside your Swift toolchain. Two cases need extra setup: cross-module and global features are limited until you have built the project, and a Swift package project that needs additional arguments on the build invocation has to be told about them separately.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. swiftlang/sourcekit-lsp on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/swiftlang-sourcekit-lsp.svg)](https://hysenlabs.com/projects/swiftlang-sourcekit-lsp)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/swiftlang-sourcekit-lsp.svg)](https://hysenlabs.com/projects/swiftlang-sourcekit-lsp)

Was this useful?