omg-lsp
v0.5.0
Published
Language Server Protocol server for OMG (OpenAPI Markdown Grammar)
Maintainers
Readme
omg-lsp
Language Server Protocol (LSP) server for OMG (OpenAPI Markdown Grammar) files.
Installation
npm install omg-lspFeatures
- Diagnostics - Real-time validation and linting
- Completions - Autocomplete for types, annotations, block types
- Hover - Documentation on hover for types and annotations
- Go to Definition - Navigate to type definitions
- Document Formatting - Format OMG files
- Document Symbols - Outline view of document structure
- Code Actions - Quick fixes for common issues
Usage with VS Code
The LSP server is used by the OMG VS Code extension.
Running Standalone
npx omg-lsp --stdioOr programmatically:
import { createConnection, ProposedFeatures } from 'vscode-languageserver/node.js';
// The server is started via the bin entry point
// See packages/omg-lsp/src/server.ts for implementationCapabilities
Completions
Triggered on: . @ { :
Block types:
```omg.|
� omg.path, omg.query, omg.body, omg.response, etc.Annotations:
age: integer @|
� @min, @max, @minLength, @maxLength, @pattern, @formatTypes:
name: |
� string, integer, number, boolean, date, datetime, uuid
� User, Product (workspace types)Frontmatter:
method: |
� GET, POST, PUT, PATCH, DELETEHover
Provides documentation for:
- Primitive types (
string,integer, etc.) - Annotations (
@min,@format, etc.) - User-defined types (shows schema structure)
Go to Definition
Jump to type definition for PascalCase references:
response: User � Ctrl+Click to jump to User definitionCode Actions
Quick fixes for common issues:
- Add missing
operationId - Add missing
tags - Make field optional with
?
Configuration
The server respects workspace settings and .spectral-omg.yaml for linting configuration.
License
MIT
