lsp-setup
Skill này làm gì
Công cụ này giúp thiết lập “language server” phù hợp cho dự án lập trình của bạn. Điều này giúp các tính năng như tìm lỗi, chuyển đến định nghĩa mã và đổi tên hàm hoạt động đúng.
Khi nào nên dùng
- ✓Khi bạn gặp lỗi báo ‘no LSP server configured’.
- ✓Khi bạn muốn các công cụ hỗ trợ mã (như tìm lỗi) hoạt động trong dự án.
- ✓Khi bạn bắt đầu một dự án mới bằng một ngôn ngữ lập trình được hỗ trợ.
Liên kết skill
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/lsp-setup/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập language server cho dự án Python của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ trước hết xác định ngôn ngữ của dự án. Sau đó, nó cài đặt language server cần thiết và cấu hình các công cụ để các tính năng hoạt động đúng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 inheritscommandautomatically — you only overrideextensions/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 byLSP_TOOLS_MCP_USER_CONFIG), wherecommand+extensionsare 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
…
Câu hỏi thường gặp
“Language server” là gì?
Đó là chương trình hiểu ngôn ngữ lập trình của bạn và giúp các công cụ soạn thảo cung cấp thông tin hữu ích, như báo lỗi và gợi ý.
Những ngôn ngữ nào được hỗ trợ?
Công cụ hỗ trợ nhiều ngôn ngữ như TypeScript, Python, Go, Rust, C/C++, Java, C#, Swift, Ruby, PHP, Dart, Elixir, Zig, Lua, Bash, YAML, Terraform, Haskell và Julia.
Tôi có cần cài đặt gì trước không?
Có, bạn có thể cần cài language server cụ thể cho ngôn ngữ lập trình của mình theo hướng dẫn mà công cụ cung cấp.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 70k
- Vị trí xếp hạng
- #3135
- Giấy phép
- NOASSERTION
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
comment-checker
70kGiúp agent của bạn hiểu và phản hồi các nhận xét từ công cụ kiểm tra bình luận tự động. Hữu ích khi xử lý kết quả từ việc rà soát mã hoặc nội dung tự động.
lcx-contribute-bug-fix
70kGiúp agent của bạn đóng góp bản sửa lỗi cho các dự án liên quan đến LazyCodex. Agent tạo issue hoặc pull request để đảm bảo chất lượng mã.
lcx-doctor
70kCho phép agent của bạn kiểm tra tình trạng cài đặt LazyCodex và Codex CLI. Hữu ích khi hệ thống hoạt động lạ sau khi cập nhật hoặc thay đổi.
lcx-report-bug
70kGiúp agent của bạn báo lỗi chi tiết cho các dự án LazyCodex. Agent tạo issue với thông tin hữu ích để lập trình viên sửa vấn đề.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.