Back to list
mcclowes

lsp

by mcclowes

OAS Markdown Grammar is a human-first domain-specific language for API specification

1🍴 0📅 Jan 12, 2026

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 onInitialize response
  • Diagnostics: Errors/warnings pushed via connection.sendDiagnostics()

Common Providers

ProviderPurposeKey Method
completionProviderAutocomplete suggestionsonCompletion
hoverProviderTooltip on hoveronHover
definitionProviderGo-to-definitiononDefinition
referencesProviderFind all referencesonReferences
documentSymbolProviderOutline/symbolsonDocumentSymbol
codeActionProviderQuick fixesonCodeAction

Key Patterns

  • Use TextDocument.positionAt(offset) and offsetAt(position) for conversions
  • Return null from handlers when no result available
  • Diagnostics use DiagnosticSeverity.Error | Warning | Information | Hint
  • Use Location for definitions, LocationLink for richer go-to-definition

Score

Total Score

65/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon