https://github.com/marc2332/lsp-codemirror
LSP integration for CodeMirror
https://github.com/marc2332/lsp-codemirror
codemirror lsp
Last synced: 9 months ago
JSON representation
LSP integration for CodeMirror
- Host: GitHub
- URL: https://github.com/marc2332/lsp-codemirror
- Owner: marc2332
- License: isc
- Created: 2020-07-09T15:44:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T13:42:48.000Z (over 2 years ago)
- Last Synced: 2025-08-30T16:13:37.682Z (10 months ago)
- Topics: codemirror, lsp
- Language: TypeScript
- Homepage:
- Size: 1.62 MB
- Stars: 45
- Watchers: 2
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⚠️ **>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
```shell
npm install lsp-codemirror
```
## ✍🏻 Usage
```javascript
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: https://github.com/marc2332/lsp-codemirror/blob/aed38cc89e992b0b9aa7ee91cd298a4607a87b60/src/types.ts#L144