Skip to content

LSP Configuration ​

The .lsp.json file maps server names to their configurations, enabling language intelligence for Claude Code.

Fields ​

FieldTypeRequiredDescription
commandstringyesCommand to start the server
extensionToLanguageobjectyesMap of file extensions to language IDs
argsstring[]noCommand arguments
transportstringnostdio or socket
envobjectnoEnvironment variables
initializationOptionsobjectnoLSP initialization options
settingsobjectnoLSP server settings
workspaceFolderstringnoOverride workspace folder path
startupTimeoutnumbernoStartup timeout (ms, min 0)
shutdownTimeoutnumbernoShutdown timeout (ms, min 0)
restartOnCrashbooleannoAuto-restart on crash (default: true)
maxRestartsnumbernoMax restart attempts (min 0)
requestTimeoutnumbernoPositive integer request timeout in milliseconds; default 60000
diagnosticsbooleannoInject diagnostics after edits; default true

Example ​

json
{
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"],
    "extensionToLanguage": {
      ".ts": "typescript",
      ".tsx": "typescriptreact"
    }
  }
}