本文へスキップ
Skillpedia
一般的なプログラミング70k · #3135

lsp-setup

できること

このツールは、プログラミングプロジェクトに適した「言語サーバー」を設定するのに役立ちます。これにより、エラーの検出、コードの定義への移動、関数の名前変更などの機能が正しく動くようになります。

使う場面

  • ✓「no LSP server configured」というエラーが表示されたとき。
  • ✓プロジェクトでエラー検出などのコード支援機能を使いたいとき。
  • ✓対応しているプログラミング言語で新しいプロジェクトを始めるとき。

スキルのリンク

https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/lsp-setup/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/lsp-setup/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Pythonプロジェクト用の言語サーバーをセットアップして。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールはまず、プロジェクトのプログラミング言語を特定します。次に、必要な言語サーバーをインストールし、機能が正しく動くようにツールを設定します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

LSP Setup

Configure the right Language Server for a project so the lsp MCP tools (diagnostics, goto_definition, find_references, symbols, rename) actually work. This skill is an index: detect what a project needs, install the server, write the config, then verify with a real roundtrip.

The list of servers we ship as builtin is the source of truth in packages/lsp-tools-mcp/src/lsp/server-definitions.ts (BUILTIN_SERVERS + LSP_INSTALL_HINTS). The per-language references below mirror it.


PHASE 0 — LANGUAGE GATE (run first)

Identify the language from the file extension, then read the matching reference before installing or configuring anything.

Extension(s) Reference
.ts .tsx .js .jsx .mjs .cjs .mts .cts .vue .svelte .astro references/typescript/README.md
.py .pyi references/python/README.md
.go references/go/README.md
.rs references/rust/README.md
.c .cpp .cc .cxx .h .hpp .hh .hxx references/c-cpp/README.md
.java references/java/README.md
.kt .kts references/kotlin/README.md
.cs .razor .cshtml references/csharp/README.md
.swift references/swift/README.md
.rb .rake .gemspec .ru references/ruby/README.md
.php references/php/README.md
.dart references/dart/README.md
.ex .exs references/elixir/README.md
.zig .zon references/zig/README.md
.lua references/lua/README.md
.sh .bash .zsh .ksh references/bash/README.md
.yaml .yml references/yaml/README.md
.tf .tfvars references/terraform/README.md
.hs .lhs references/haskell/README.md
.jl references/julia/README.md

WORKFLOW — detect → install → configure → verify

1. Detect

Scan the project to see which languages are present and whether each server is installed and configured:

bun scripts/detect-lsp.ts <projectDir>      # human report (default: cwd)
bun scripts/detect-lsp.ts <projectDir> --json

For each detected language it prints the builtin server id, the executable it needs on PATH, whether that executable is installed, an install hint, and whether a project config file already references it.

2. Install

Open references/<language>/README.md and run the install command for your OS. Then confirm the executable resolves:

command -v <server-executable>   # e.g. typescript-language-server, gopls, rust-analyzer

3. Configure

Most builtin servers need no config — they are resolved automatically by file extension. Write config only to: pick between competing servers, set a priority, pass initialization options, override extensions, set env, or disable a server.

Two project-scoped config files, identical JSON shape:

  • Codex harness → .codex/lsp-client.json (user: ~/.codex/lsp-client.json)
  • OpenCode/omo harness → .opencode/lsp.json (also .omo/lsp.json)
{
  "lsp": {
    "<server-id>": {
      "command": ["<bin>", "<args>"],   // optional for builtin ids (supplied automatically)
      "extensions": [".ext"],            // optional override
      "priority": 100,                    // higher wins when several servers match an extension
      "initialization": { },              // server-specific initializationOptions
      "env": { "KEY": "value" },          // optional
      "disabled": false                   // set true to turn a server off
    }
  }
}

Rules enforced by config-loader.ts:

  • In a project config (.codex/lsp-client.json, .opencode/lsp.json) an entry whose id is a builtin server inherits command automatically — you only override extensions / priority / initialization. A non-builtin id in a project config is ignored.
  • To define a fully custom (non-builtin) server with its own command, put it in the user config (~/.codex/lsp-client.json, or the path set by LSP_TOOLS_MCP_USER_CONFIG), where command + extensions are honored.
  • Project entries win over user entries; both win over builtin defaults.

Each language reference gives a ready-to-paste snippet.

4. Verify

Run a real diagnostics roundtrip against a source file. This spawns the server, opens the file, requests diagnostics, and reports OK/FAIL:

bun scripts/verify-lsp.ts <path/to/file.ext>
bun scripts/verify-lsp.ts <file> --timeout=90000

…

よくある質問

「言語サーバー」とは何ですか?

プログラミング言語を理解するプログラムで、コードエディタのツールがエラーや候補などの便利な情報を表示できるように支援します。

どの言語に対応していますか?

TypeScript、Python、Go、Rust、C/C++、Java、C#、Swift、Ruby、PHP、Dart、Elixir、Zig、Lua、Bash、YAML、Terraform、Haskell、Juliaなど、さまざまな言語に対応しています。

事前に何かインストールが必要ですか?

はい。使用するプログラミング言語に対応した言語サーバーを、ツールが示す手順に従ってインストールする必要がある場合があります。

詳細

作者による元の説明

Configures a language server so editor/agent tooling (diagnostics, go-to-definition, references, rename) works. Use when a project needs an LSP installed or wired, or a 'no LSP server configured' error appears.

repo: code-yeongyu/oh-my-openagent

人気

GitHubのスター
70k
ランキング
#3135
ライセンス
NOASSERTION
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル