Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Package.swift LSPNew to Visual Studio Code? Get it now.
Package.swift LSP

Package.swift LSP

kattouf

|
24 installs
| (0) | Free
Language Server Protocol (LSP) implementation for Swift Package Manager's Package.swift manifest files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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.

demo

Features

  • Smart code completion for Package.swift manifest files:

    • In .package(...) function:
      • url: argument with GitHub repository suggestions
      • from: and exact: arguments with version suggestions
      • branch: argument with available branch names
    • In .product(...) function:
      • name: argument with available product suggestions from dependencies
      • package: argument with package name suggestions

    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.

  • Contextual hover information:

    • Package details including location and state when hovering over package names
    • Available products in the package

Requirements

  • macOS (currently only supported on macOS platforms)
  • x86_64 or arm64 architecture

Installation

You can install this extension directly from the Visual Studio Code Marketplace or by building it from source.

Building from Source

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to compile TypeScript files
  4. Run npm run package to create the VSIX package
  5. 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:

  1. Check if a custom path to the language server is configured
  2. If not, look for the language server in PATH
  3. If not found, download the latest release from GitHub
  4. 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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft