← スキル一覧に戻る

lsp
by mcclowes
OAS Markdown Grammar is a human-first domain-specific language for API specification
⭐ 1🍴 0📅 2026年1月12日
SKILL.md
name: lsp
prettier-ignore
description: Use when implementing Language Server Protocol features - diagnostics, completions, hover, go-to-definition, and editor integration
Language Server Protocol (LSP)
Quick Start
import { createConnection, TextDocuments, ProposedFeatures } from 'vscode-languageserver/node';
import { TextDocument } from 'vscode-languageserver-textdocument';
const connection = createConnection(ProposedFeatures.all);
const documents = new TextDocuments(TextDocument);
connection.onInitialize((params) => ({
capabilities: {
textDocumentSync: TextDocumentSyncKind.Incremental,
completionProvider: { resolveProvider: true },
hoverProvider: true,
definitionProvider: true,
diagnosticProvider: { interFileDependencies: false, workspaceDiagnostics: false }
}
}));
documents.onDidChangeContent((change) => {
validateDocument(change.document);
});
documents.listen(connection);
connection.listen();
Core Concepts
- Connection: JSON-RPC communication channel between client and server
- TextDocuments: Manages open document state with incremental sync
- Capabilities: Server declares features in
onInitializeresponse - Diagnostics: Errors/warnings pushed via
connection.sendDiagnostics()
Common Providers
| Provider | Purpose | Key Method |
|---|---|---|
completionProvider | Autocomplete suggestions | onCompletion |
hoverProvider | Tooltip on hover | onHover |
definitionProvider | Go-to-definition | onDefinition |
referencesProvider | Find all references | onReferences |
documentSymbolProvider | Outline/symbols | onDocumentSymbol |
codeActionProvider | Quick fixes | onCodeAction |
Key Patterns
- Use
TextDocument.positionAt(offset)andoffsetAt(position)for conversions - Return
nullfrom handlers when no result available - Diagnostics use
DiagnosticSeverity.Error | Warning | Information | Hint - Use
Locationfor definitions,LocationLinkfor richer go-to-definition
スコア
総合スコア
65/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です
