Repository navigation
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 1 commit
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,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: 1061
🌐 Web query:
YAML language identifier LSP language server protocol💡 Result:
Standard LSP language identifier (languageId) for YAML: "yaml". [1]
Common YAML LSP server: Red Hat's yaml-language-server (invoked as the binary
yaml-language-server, client name oftenyamlls), typically started withyaml-language-server --stdio. [2]Sources: [1] Red Hat yaml-language-server README; [2] lsp-mode / nvim-lsp docs.
Change
.ymlextension mapping from"yml"to"yaml".The
.ymlextension currently maps to the language identifier"yml", while.yamlmaps to"yaml". According to LSP standards, the correct language identifier for YAML files is"yaml". Both extensions should map to the same identifier for consistent language server initialization.Current code (lines 37-40)
Change
".yml": "yml"to".yml": "yaml".🤖 Prompt for AI Agents