claude-code-svelte-lsp Svelte Themes

Claude Code Svelte Lsp

Svelte language server plugin for Claude Code - adds LSP support for .svelte files

svelte-lsp

Svelte language server plugin for Claude Code, providing code intelligence features for Svelte components.

Note: This plugin is now available through the Intergrado Claude Plugins marketplace for easier installation.

Features

This plugin enables the following LSP features for .svelte files in Claude Code:

  • Go to Definition - Jump to where symbols are defined
  • Find References - Find all usages of a symbol
  • Hover Information - View documentation and type information
  • Document Symbols - List all symbols in a file
  • Workspace Symbols - Search for symbols across your project
  • Diagnostics - See errors and warnings in your Svelte components

Supported Extensions

.svelte

Step 1: Install Svelte Language Server

The Svelte language server must be installed globally on your system before the plugin can work.

Windows

Using npm (comes with Node.js):

npm install -g svelte-language-server

Using pnpm:

pnpm add -g svelte-language-server

Using yarn:

yarn global add svelte-language-server

Verify installation (PowerShell):

Get-Command svelteserver
# Should output something like: C:\Users\<username>\AppData\Roaming\npm\svelteserver.cmd

Verify installation (cmd.exe):

where svelteserver
# Should output something like: C:\Users\<username>\AppData\Roaming\npm\svelteserver.cmd

Note: If svelteserver is not found, ensure your npm global bin directory is in your PATH. Run npm config get prefix to find the npm prefix, then add <prefix> to your PATH.

macOS

Using npm:

npm install -g svelte-language-server

Using pnpm:

pnpm add -g svelte-language-server

Using yarn:

yarn global add svelte-language-server

Using Homebrew (alternative):

# First install Node.js if not already installed
brew install node

# Then install svelte-language-server
npm install -g svelte-language-server

Verify installation:

which svelteserver
# Should output something like: /usr/local/bin/svelteserver or ~/.npm-global/bin/svelteserver

Linux

Using npm:

npm install -g svelte-language-server

Using pnpm:

pnpm add -g svelte-language-server

Using yarn:

yarn global add svelte-language-server

Verify installation:

which svelteserver
# Should output something like: /usr/local/bin/svelteserver or ~/.local/share/pnpm/svelteserver

Note: On Linux, you may need to configure npm to install global packages without sudo. See npm documentation for details.

Step 2: Install the Plugin in Claude Code

Add the Intergrado marketplace and install the plugin:

# Add the marketplace
claude plugin marketplace add intergrado/intergrado-claude-plugins

# Install the plugin
claude plugin install svelte-lsp@intergrado-claude-plugins

Option B: Install directly from this repository

Clone and install directly:

git clone https://github.com/intergrado/claude-code-svelte-lsp.git
claude plugin install ./claude-code-svelte-lsp

Step 3: Restart Claude Code

After installing the plugin, restart Claude Code for the LSP server to initialize.

Usage

Once installed, Claude Code will automatically use the Svelte LSP for .svelte files. You can use LSP features like:

# Get document symbols
LSP(documentSymbol) on src/App.svelte

# Go to definition (specify line and character)
LSP(goToDefinition) on src/App.svelte:10:5

# Find all references
LSP(findReferences) on src/lib/Button.svelte:15:10

# Get hover information
LSP(hover) on src/routes/+page.svelte:20:8

Troubleshooting

"No LSP server available for file type: .svelte"

  1. Ensure svelte-language-server is installed globally (see Step 1)
  2. Verify svelteserver is in your PATH:
    • Windows (PowerShell): Get-Command svelteserver
    • Windows (cmd): where svelteserver
    • macOS/Linux: which svelteserver
  3. Restart Claude Code after installing the plugin

Plugin not found

  1. Check that the marketplace was added successfully:

    claude plugin marketplace list
    
  2. Update the marketplace:

    claude plugin marketplace update intergrado-claude-plugins
    

Plugin validation fails

Run the validation command to check for issues:

claude plugin validate /path/to/claude-code-svelte-lsp

Debug logs

Check Claude Code debug logs for LSP-related errors:

Linux/macOS:

ls ~/.claude/debug/
grep -i "svelte\|lsp" ~/.claude/debug/<latest-session>.txt

Windows (PowerShell):

Get-ChildItem "$env:USERPROFILE\.claude\debug"
Select-String -Pattern "svelte|lsp" -Path "$env:USERPROFILE\.claude\debug\<latest-session>.txt"

Windows (cmd.exe):

dir "%USERPROFILE%\.claude\debug"
findstr /i "svelte lsp" "%USERPROFILE%\.claude\debug\<latest-session>.txt"

More Information

License

MIT

Top categories

Loading Svelte Themes