marc2332 / lsp-codemirror

LSP integration for CodeMirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ >UNMAINTAINED< ⚠️

You can use this alternative (not very much up to date anyway): https://github.com/FurqanSoftware/codemirror-languageserver

✨ lsp-codemirror

LSP client for CodeMirror, intends to be a more updated and better version of the original client --> https://github.com/wylieconlon/lsp-editor-adapter (thanks to Wylie :D )

🤔 Differences

  • Autocompletion improvements
  • Built-in icons
  • Support for custom autocompletion dropmenus

🤖 Installation

npm install lsp-codemirror

✍🏻 Usage

import CodeMirror from 'codemirror';
import { LspWsConnection, CodeMirrorAdapter } from 'lsp-codemirror';

const editor = CodeMirror(document.body,{})

const javascriptConnection = new LspWsConnection({
	serverUri: 'ws://localhost:2089/javascript',
	mode: 'javascript',
	rootUri: `file:///users/superman`,
	documentUri: `file:///users/superman/index.js`,
	documentText: () => editor.getValue(),
}).connect(new WebSocket('ws://localhost:2089/javascript'));

const javascriptAdapter = new CodeMirrorAdapter(javascriptConnection, {
	quickSuggestionsDelay: 25,
}, editor);

All options for CodeMirrorAdapter in:

export interface ITextEditorOptions {

About

LSP integration for CodeMirror

License:ISC License


Languages

Language:TypeScript 94.0%Language:JavaScript 3.9%Language:CSS 1.2%Language:HTML 0.9%