Package.swift LSP for Visual Studio Code
A Visual Studio Code extension that provides language server protocol (LSP) support for Swift Package Manager's Package.swift manifest files.
Powered by the Package.swift LSP server.

Features
Language server for Package.swift files that provides:
Note: After editing package dependencies (.package(...)
), save the file for changes to be reflected in target completions.
Warning: This extension activates autocompletion inside string literals for all Swift files in the workspace, not just Package.swift files.
Requirements
- macOS or Linux
- x86_64 or arm64 architecture
Installation
Quick Install Options
Option 1: Terminal command (macOS only)
open vscode:extension/kattouf.package-swift-lsp
For Cursor users:
open vscode:extension/kattouf.package-swift-lsp
Option 2: From Marketplace
Option 3: From VS Code Extensions
- Open VS Code
- Go to Extensions tab (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Package.swift LSP"
- Click Install
Building from Source
- Clone this repository
- Run
npm install
to install dependencies
- Run
npm run compile
to compile TypeScript files
- Run
npm run package
to create the VSIX package
- Install the VSIX package in VS Code using the "Install from VSIX..." command
Extension Settings
This extension contributes the following settings:
package-swift-lsp.enable
: Enable/disable the Package.swift LSP extension
package-swift-lsp.path
: Optional path to a custom package-swift-lsp executable
How it Works
On first activation, the extension will:
- Check if a custom path to the language server is configured
- If not, look for the language server in PATH
- If not found, download the latest release from GitHub
- Start the language server for Package.swift files and versioned manifest files (Package@swift-X.Y.Z.swift)
The extension will only activate for files that exactly match the pattern Package.swift
or Package@swift-X.Y.Z.swift
where X, Y, and Z are version numbers.
License
This extension is available under the MIT license.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.