Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,5 @@
"name": "config-lsp",
"version": "1.0.0",
"description": "Language Server Protocol configuration for Claude Code",
"languageServers": {
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"],
"filetypes": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"rootPatterns": ["package.json", "tsconfig.json"]
},
"bash": {
"command": "bash-language-server",
"args": ["start"],
"filetypes": ["sh", "bash"],
"rootPatterns": [".git"]
},
"json": {
"command": "vscode-json-language-server",
"args": ["--stdio"],
"filetypes": ["json", "jsonc"],
"rootPatterns": ["package.json"]
},
"yaml": {
"command": "yaml-language-server",
"args": ["--stdio"],
"filetypes": ["yaml", "yml"],
"rootPatterns": [".git"]
}
}
"lspServers": "../.lsp.json"
}
17 changes: 15 additions & 2 deletions .claude/commands/devcontainer-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,18 @@ ls -la .claude-plugin/plugin.json

# LSP設定ファイルの内容確認
cat .claude-plugin/plugin.json

# lspServersキーが正しく設定されているか確認
cat .claude-plugin/plugin.json | jq '.lspServers | keys'
```

**確認ポイント:**

- [ ] `.claude-plugin/plugin.json` が存在する
- [ ] JSONが正しくフォーマットされている
- [ ] `lspServers` キーが使用されている(`languageServers` ではない)
- [ ] 4つのLanguage Server設定が含まれている(typescript, bash, json, yaml)
- [ ] 各サーバーに `extensionToLanguage` マッピングが設定されている

### Claude Code LSP機能の確認

Expand Down Expand Up @@ -293,13 +298,21 @@ act -l
### LSPが動作しない場合

```bash
# Language Serverを手動でインストール
# Language Serverセットアップスクリプトを実行
bash script/setup-lsp.sh

# または手動でインストール
npm install -g typescript-language-server typescript bash-language-server vscode-langservers-extracted yaml-language-server

# LSP設定ファイルの確認
cat .claude-plugin/plugin.json | jq '.lspServers | keys'

# Claude Codeを再起動
# VS Code/Cursorを再起動
```

**注意**: LSP設定では `lspServers` キーと `extensionToLanguage` プロパティを使用してください。古い形式の `languageServers` と `filetypes` は動作しません。

### 環境変数が読み込まれない場合

```bash
Expand Down Expand Up @@ -337,4 +350,4 @@ npm run format:check && npm run lint && npm test
---

**最終更新**: 2026-01-04
**対象バージョン**: Claude Code 2.0.76+, DevContainer config-base 1.42.0+
**対象バージョン**: Claude Code 2.0.76+, DevContainer config-base 1.43.0+
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"deny": []
},
"enabledPlugins": {
"config-lsp": true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, check if the files mentioned exist and explore the structure
git ls-files | grep -E "(claude|settings|plugin)" | head -20

Repository: keito4/config

Length of output: 850


🏁 Script executed:

# Look at the .claude/settings.json file to verify the change context
if [ -f ".claude/settings.json" ]; then
  echo "=== .claude/settings.json ===" 
  cat -n ".claude/settings.json" | head -120
else
  echo "File not found"
fi

Repository: keito4/config

Length of output: 4252


🏁 Script executed:

# Check if .claude-plugin/plugin.json exists
if [ -f ".claude-plugin/plugin.json" ]; then
  echo "=== .claude-plugin/plugin.json ===" 
  cat ".claude-plugin/plugin.json"
else
  echo "File not found"
fi

Repository: keito4/config

Length of output: 1096


🏁 Script executed:

# Look for CLAUDE.md to understand development quality standards
if [ -f "CLAUDE.md" ]; then
  echo "=== CLAUDE.md ===" 
  cat "CLAUDE.md"
else
  echo "CLAUDE.md not found in root"
fi

Repository: keito4/config

Length of output: 4030


🏁 Script executed:

# Check if there are any references to "config-lsp" plugin in the codebase
rg "config-lsp" --type json

Repository: keito4/config

Length of output: 39


LGTM! Verify LSP functionality before merging.

The addition of "config-lsp": true correctly 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
In .claude/settings.json around line 107, you enabled "config-lsp": true but
haven’t verified LSP functionality in the DevContainer; follow the PR test plan
to validate and fix integration: start the DevContainer, open representative
TypeScript, Bash, JSON, and YAML files, confirm language servers activate,
diagnostics/hover/completion/formatting work with Claude Code, inspect extension
and plugin logs for errors, adjust plugin.json or settings.json (e.g., server
paths, activation events, workspaceFolder mappings, environment variables) or
install missing language-server binaries as needed, and document the
verification steps and any fixes before merging.

"frontend-design@claude-code-plugins": true,
"supabase-toolkit@claude-code-templates": true,
"documentation-generator@claude-code-templates": true,
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"remoteEnv": {
"HOMEBREW_NO_AUTO_UPDATE": "1",
"SHELL": "/bin/bash",
"TMPDIR": "/home/vscode/.claude/tmp"
"TMPDIR": "/home/vscode/.claude/tmp",
"ENABLE_LSP_TOOL": "1"
},
"overrideCommand": true,
"updateRemoteUserUID": false,
Expand All @@ -50,6 +51,6 @@
}
}
},
"postCreateCommand": "bash script/setup-env.sh && bash script/setup-mcp.sh && sudo chown -R vscode:vscode /workspaces/config && npm ci && npm run prepare && cp -r /tmp/.husky /workspaces/config/ && cp git/commitlint.config.js commitlint.config.js && bash script/sync-claude-commands.sh && /usr/local/bin/setup-claude.sh",
"postCreateCommand": "bash script/setup-env.sh && bash script/setup-mcp.sh && sudo chown -R vscode:vscode /workspaces/config && npm ci && npm run prepare && cp -r /tmp/.husky /workspaces/config/ && cp git/commitlint.config.js commitlint.config.js && bash script/sync-claude-commands.sh && bash script/setup-lsp.sh && /usr/local/bin/setup-claude.sh",
"runArgs": ["--env-file=${localEnv:HOME}/.devcontainer.env"]
}
38 changes: 38 additions & 0 deletions .lsp.json
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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 typescript-language-server is correct. However, line 35 has an issue: the .yml extension should map to "yaml" (not "yml"), as "yaml" is the VSCode language identifier for both .yaml and .yml files.

🤖 Prompt for AI Agents
In .lsp.json around lines 2 to 13, the language mapping for the YAML file
extension is incorrect; update the mapping so that ".yml" maps to "yaml" (the
VSCode language identifier) instead of "yml" — ensure any YAML extension entries
(e.g., ".yml", and optionally ".yaml") use the value "yaml".

"bash": {
"command": "bash-language-server",
"args": ["start"],
"extensionToLanguage": {
".sh": "sh",
".bash": "bash"
}
},
Comment on lines +14 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

bash-language-server npm configuration command arguments --stdio

💡 Result:

Use the "start" subcommand — you do not pass a separate --stdio flag. Example editor/client configs:

  • coc.nvim / VSCode settings:
    "language.bash.languageServer.command": "bash-language-server",
    "language.bash.languageServer.arguments": ["start"]. [1][2]

  • nvim-lspconfig (Lua):
    cmd = { "bash-language-server", "start" }. [3]

The server speaks the Language Server Protocol over stdio when started with "start", so no explicit --stdio argument is required. [1][3]

Sources:
[1] npm bash-language-server README.
[2] npm package documentation examples.
[3] GitHub bash-language-server README.


🌐 Web query:

language identifiers shell bash sh vscode lsp languageId

💡 Result:

Short answer:

  • VS Code's built-in Shell Script language identifier is "shellscript". [1]
  • Some extensions may define their own ids (e.g. an extension could use "bash" — check the extension's package.json). [1]
  • For the Language Server Protocol, the editor sends the languageId (e.g. "shellscript") in the initialize/didOpen notifications; extensions declare their language id in package.json under "languages". [1][2]

How to confirm / use it:

  • See the known identifiers list (shows Shell Script → "shellscript"). [1]
  • To associate files: add to settings.json:
    "files.associations": { "*.sh": "shellscript", "myfile": "shellscript" }. [1]
  • To find an installed language's id in VS Code: open Change Language Mode (Ctrl/Cmd+K M) or inspect an extension's package.json "languages" entry. [2]

Sources:
[1] Visual Studio Code — Language Identifiers (official docs).
[2] Visual Studio Code — Programming Languages / Language identifier (official docs).


🏁 Script executed:

cat -n .lsp.json | head -50

Repository: keito4/config

Length of output: 1112


Update Bash language identifiers to match VS Code standard.

The bash configuration correctly uses "start" as the argument (this is the correct subcommand for bash-language-server), but the language identifiers are incorrect. VS Code's standard Shell Script identifier is "shellscript", not "sh" and "bash".

Update the extensionToLanguage mapping:

"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
In .lsp.json around lines 14 to 21, the bash language mapping uses nonstandard
identifiers ("sh" and "bash"); update the extensionToLanguage mapping so both
".sh" and ".bash" map to VS Code's standard "shellscript" identifier to ensure
the bash-language-server receives proper file notifications.

"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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

VSCode language identifier yaml yml correct standard

💡 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:
[1] VS Code Language Identifiers (built‑in list) — YAML = "yaml".
[2] redhat-developer vscode-yaml (YAML support/extension; recognizes .yaml/.yml).


🌐 Web query:

yaml-language-server correct command name npm package

💡 Result:

The npm package is named "yaml-language-server" and the CLI command it installs is yaml-language-server (commonly run as yaml-language-server --stdio). [1][2]

Sources:

  • npm package page for yaml-language-server. [1]
  • yaml-language-server README / docs showing node .../server.js [--stdio] / usage (--stdio). [2]

Fix YAML language identifier mapping.

Line 35 maps .yml to "yml", but VSCode language identifiers use "yaml" (lowercase) for both .yaml and .yml files. This will cause .yml files to not be properly recognized by the language server. The command name yaml-language-server and --stdio argument are correct.

Fix
   "yaml": {
     "command": "yaml-language-server",
     "args": ["--stdio"],
     "extensionToLanguage": {
       ".yaml": "yaml",
-      ".yml": "yml"
+      ".yml": "yaml"
     }
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"yaml": {
"command": "yaml-language-server",
"args": ["--stdio"],
"extensionToLanguage": {
".yaml": "yaml",
".yml": "yml"
}
}
"yaml": {
"command": "yaml-language-server",
"args": ["--stdio"],
"extensionToLanguage": {
".yaml": "yaml",
".yml": "yaml"
}
}
🤖 Prompt for AI Agents
In .lsp.json around lines 30 to 37, the language mapping maps ".yml" to "yml"
which is incorrect; update the extensionToLanguage mapping so both ".yaml" and
".yml" map to the VSCode language identifier "yaml" (lowercase) so the
yaml-language-server recognizes .yml files correctly.

}
8 changes: 4 additions & 4 deletions npm/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@
"overridden": false
},
"bash-language-server": {
"version": "5.4.0",
"version": "5.6.0",
"overridden": false
},
"codex": {
"version": "0.2.3",
"overridden": false
},
"typescript": {
"version": "5.7.3",
"version": "5.9.3",
"overridden": false
},
"typescript-language-server": {
"version": "4.3.3",
"version": "5.1.3",
"overridden": false
},
"vscode-langservers-extracted": {
"version": "4.10.0",
"overridden": false
},
"yaml-language-server": {
"version": "1.16.0",
"version": "1.19.2",
"overridden": false
},
"corepack": {
Expand Down
59 changes: 59 additions & 0 deletions script/setup-lsp.sh
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Consider propagating failure status via exit code.

The script uses set -e but unconditionally exits with 0 even when language servers are missing. This masks failures from the calling process (devcontainer postCreateCommand), making troubleshooting harder if LSP installation silently fails.

🔎 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 $errors

If 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
In script/setup-lsp.sh around lines 5 and 53-59, the script currently uses set
-e but ends by unconditionally exiting with 0 which hides failures; modify the
flow so the script returns a non-zero exit code when any LSP install or check
fails (e.g., track a failure flag or capture command exit statuses and exit with
that code), or make this behavior configurable via an environment variable
(e.g., SKIP_LSP_ERRORS=true to preserve an exit 0) and document the default to
fail the DevContainer postCreateCommand; ensure any early returns respect set -e
and propagate the actual error code instead of always exiting 0.


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
Loading