-
Notifications
You must be signed in to change notification settings - Fork 0
feat: fix LSP configuration for Claude Code integration #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
943ea62
f6fa862
f0474e9
f205501
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| "typescript": { | ||||||||||||||||||||||||||||||||||
| "command": "typescript-language-server", | ||||||||||||||||||||||||||||||||||
| "args": ["--stdio"], | ||||||||||||||||||||||||||||||||||
| "extensionToLanguage": { | ||||||||||||||||||||||||||||||||||
| ".js": "javascript", | ||||||||||||||||||||||||||||||||||
| ".jsx": "javascriptreact", | ||||||||||||||||||||||||||||||||||
| ".ts": "typescript", | ||||||||||||||||||||||||||||||||||
| ".tsx": "typescriptreact", | ||||||||||||||||||||||||||||||||||
| ".mjs": "javascript", | ||||||||||||||||||||||||||||||||||
| ".cjs": "javascript" | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+2
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for .cts and .mts files in the repository
fd -e cts -e mts
# Check for package.json and typescript configuration
find . -name "package.json" -o -name "tsconfig.json" | head -20
# Display the .lsp.json file to see full context
cat -n .lsp.json 2>/dev/null || echo "File not found at root"Repository: keito4/config Length of output: 1127 Fix incorrect YAML extension language mapping. The TypeScript server command 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| "bash": { | ||||||||||||||||||||||||||||||||||
| "command": "bash-language-server", | ||||||||||||||||||||||||||||||||||
| "args": ["start"], | ||||||||||||||||||||||||||||||||||
| "extensionToLanguage": { | ||||||||||||||||||||||||||||||||||
| ".sh": "sh", | ||||||||||||||||||||||||||||||||||
| ".bash": "bash" | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Use the "start" subcommand — you do not pass a separate --stdio flag. Example editor/client configs:
The server speaks the Language Server Protocol over stdio when started with "start", so no explicit --stdio argument is required. [1][3] Sources: 🌐 Web query:
💡 Result: Short answer:
How to confirm / use it:
Sources: 🏁 Script executed: cat -n .lsp.json | head -50Repository: keito4/config Length of output: 1112 Update Bash language identifiers to match VS Code standard. The bash configuration correctly uses Update the "extensionToLanguage": {
".sh": "shellscript",
".bash": "shellscript"
}This matches the pattern used by other servers in this file and ensures the language server receives file notifications for shell scripts. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| "json": { | ||||||||||||||||||||||||||||||||||
| "command": "vscode-json-language-server", | ||||||||||||||||||||||||||||||||||
| "args": ["--stdio"], | ||||||||||||||||||||||||||||||||||
| "extensionToLanguage": { | ||||||||||||||||||||||||||||||||||
| ".json": "json", | ||||||||||||||||||||||||||||||||||
| ".jsonc": "jsonc" | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
| "yaml": { | ||||||||||||||||||||||||||||||||||
| "command": "yaml-language-server", | ||||||||||||||||||||||||||||||||||
| "args": ["--stdio"], | ||||||||||||||||||||||||||||||||||
| "extensionToLanguage": { | ||||||||||||||||||||||||||||||||||
| ".yaml": "yaml", | ||||||||||||||||||||||||||||||||||
| ".yml": "yml" | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+30
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Use the language identifier "yaml" (lowercase). VS Code's built-in language id is "yaml"; both file extensions ".yaml" and ".yml" are supported by YAML language extensions. Example settings entry: "files.associations": { ".yml": "yaml", ".yaml": "yaml" }. [1][2] Sources: 🌐 Web query:
💡 Result: The npm package is named "yaml-language-server" and the CLI command it installs is yaml-language-server (commonly run as Sources:
Fix YAML language identifier mapping. Line 35 maps Fix "yaml": {
"command": "yaml-language-server",
"args": ["--stdio"],
"extensionToLanguage": {
".yaml": "yaml",
- ".yml": "yml"
+ ".yml": "yaml"
}
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/bin/bash | ||
| # Language Server Protocol Setup Script | ||
| # Installs language servers required for Claude Code LSP integration | ||
|
|
||
| set -e | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider propagating failure status via exit code. The script uses 🔎 Proposed fix to propagate error status if [ $errors -eq 0 ]; then
echo "=== All Language Servers installed successfully ==="
else
echo "=== Warning: $errors language server(s) missing ==="
fi
-exit 0
+exit $errorsIf a non-zero exit would break the DevContainer build, consider making it configurable or at least documenting the intentional silent failure behavior. Also applies to: 53-59 🤖 Prompt for AI Agents |
||
|
|
||
| echo "=== Installing Language Servers ===" | ||
|
|
||
| # Check if npm is available | ||
| if ! command -v npm &> /dev/null; then | ||
| echo "Error: npm is not installed" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Define language servers to install | ||
| LANGUAGE_SERVERS=( | ||
| "typescript" | ||
| "typescript-language-server" | ||
| "bash-language-server" | ||
| "vscode-langservers-extracted" | ||
| "yaml-language-server" | ||
| ) | ||
|
|
||
| # Install language servers globally | ||
| echo "Installing language servers globally..." | ||
| npm install -g "${LANGUAGE_SERVERS[@]}" | ||
|
|
||
| # Verify installation | ||
| echo "" | ||
| echo "=== Verifying Language Server Installation ===" | ||
|
|
||
| verify_command() { | ||
| local cmd=$1 | ||
| local name=$2 | ||
| if command -v "$cmd" &> /dev/null; then | ||
| version=$($cmd --version 2>/dev/null | head -1 || echo "installed") | ||
| echo "[OK] $name: $version" | ||
| return 0 | ||
| else | ||
| echo "[MISSING] $name" | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| errors=0 | ||
| verify_command "typescript-language-server" "TypeScript LSP" || ((errors++)) | ||
| verify_command "bash-language-server" "Bash LSP" || ((errors++)) | ||
| verify_command "yaml-language-server" "YAML LSP" || ((errors++)) | ||
| verify_command "vscode-json-language-server" "JSON LSP" || ((errors++)) | ||
| verify_command "tsc" "TypeScript Compiler" || ((errors++)) | ||
|
|
||
| echo "" | ||
| if [ $errors -eq 0 ]; then | ||
| echo "=== All Language Servers installed successfully ===" | ||
| else | ||
| echo "=== Warning: $errors language server(s) missing ===" | ||
| fi | ||
|
|
||
| exit 0 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: keito4/config
Length of output: 850
🏁 Script executed:
Repository: keito4/config
Length of output: 4252
🏁 Script executed:
Repository: keito4/config
Length of output: 1096
🏁 Script executed:
Repository: keito4/config
Length of output: 4030
🏁 Script executed:
Repository: keito4/config
Length of output: 39
LGTM! Verify LSP functionality before merging.
The addition of
"config-lsp": truecorrectly enables the local LSP plugin configuration defined in.claude-plugin/plugin.json, which aligns with the PR's objective to fix LSP configuration for Claude Code integration.Per the PR test plan, DevContainer LSP verification is incomplete. Please ensure the TypeScript, Bash, JSON, and YAML language servers integrate correctly with Claude Code and provide expected functionality in the DevContainer environment before merging.
🤖 Prompt for AI Agents