monaco-languageserver-types
Convert between language server types and Monaco editor
types.
Table of Contents
Installation
npm install monaco-languageserver-types
Usage
This package exports function to convert language server types to Monaco editor types and vise
versa. It does so without importing monaco-editor
or vscode-languageserver-protocol
, meaning it
has no runtime dependencies.
For each Monaco editor / language server type, there are two functions:
from*
converts a value from a Monaco editor type to a language server type.to*
converts a value from a language server type to a Monaco editor type.
For example:
import type * as monaco from 'monaco-editor'
import { fromRange, toRange } from 'monaco-languageserver-types'
const monacoRange: monaco.IRange = {
startLineNumber: 1,
startColumn: 2,
endLineNumber: 3,
endColumn: 4
}
const lsRange = fromRange(monacoRange)
console.log(toRange(lsRange))
License
MIT © Remco Haszing