@codemirror/lsp-client
Advanced tools
+8
-0
@@ -0,1 +1,9 @@ | ||
| ## 6.1.1 (2025-09-02) | ||
| ### Bug fixes | ||
| Properly declare the @codemirror/lint dependency. | ||
| Make sure document changes are eagerly pushed to the server when `serverDiagnostics` is active. | ||
| ## 6.1.0 (2025-08-23) | ||
@@ -2,0 +10,0 @@ |
+2
-1
| { | ||
| "name": "@codemirror/lsp-client", | ||
| "version": "6.1.0", | ||
| "version": "6.1.1", | ||
| "description": "Language server protocol client for CodeMirror", | ||
@@ -21,2 +21,3 @@ "keywords": [ | ||
| "@codemirror/language": "^6.11.0", | ||
| "@codemirror/lint": "^6.8.5", | ||
| "@codemirror/state": "^6.5.2", | ||
@@ -23,0 +24,0 @@ "@codemirror/view": "^6.37.0", |
+20
-1
| import type * as lsp from "vscode-languageserver-protocol" | ||
| import {setDiagnostics} from "@codemirror/lint" | ||
| import {ViewPlugin, ViewUpdate} from "@codemirror/view" | ||
| import {LSPPlugin} from "./plugin" | ||
@@ -10,2 +11,19 @@ import {LSPClientExtension} from "./client" | ||
| const autoSync = ViewPlugin.fromClass(class { | ||
| pending = -1 | ||
| update(update: ViewUpdate) { | ||
| if (update.docChanged) { | ||
| if (this.pending > -1) clearTimeout(this.pending) | ||
| this.pending = setTimeout(() => { | ||
| this.pending = -1 | ||
| let plugin = LSPPlugin.get(update.view) | ||
| if (plugin) plugin.client.sync() | ||
| }, 500) | ||
| } | ||
| } | ||
| destroy() { | ||
| if (this.pending > -1) clearTimeout(this.pending) | ||
| } | ||
| }) | ||
| export function serverDiagnostics(): LSPClientExtension { | ||
@@ -28,4 +46,5 @@ return { | ||
| } | ||
| } | ||
| }, | ||
| editorExtension: autoSync | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
275519
0.72%6384
0.98%8
14.29%+ Added
+ Added