Language Server Protocol server for OMG (OpenAPI Markdown Grammar)
npm install omg-lspLanguage Server Protocol (LSP) server for OMG (OpenAPI Markdown Grammar) files.
``bash`
npm install omg-lsp
- 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
The LSP server is used by the OMG VS Code extension.
`bash`
npx omg-lsp --stdio
Or programmatically:
`typescript
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 implementation
`
Triggered on: . @ { :
Block types:
``omg.|`
� omg.path, omg.query, omg.body, omg.response, etc.
Annotations:
``
age: integer @|
� @min, @max, @minLength, @maxLength, @pattern, @format
Types:
``
name: |
� string, integer, number, boolean, date, datetime, uuid
� User, Product (workspace types)
Frontmatter:
``
method: |
� GET, POST, PUT, PATCH, DELETE
Provides documentation for:
- Primitive types (string, integer, etc.)@min
- Annotations (, @format, etc.)
- User-defined types (shows schema structure)
Jump to type definition for PascalCase references:
``
response: User � Ctrl+Click to jump to User definition
Quick fixes for common issues:
- Add missing operationIdtags
- Add missing ?
- Make field optional with
The server respects workspace settings and .spectral-omg.yaml` for linting configuration.
MIT