codemirror-languageserver 1.12.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/demo.js +84 -0
- package/demo/dist/demo.js +40349 -0
- package/demo/index.html +17 -0
- package/dist/index.d.ts +13 -11
- package/dist/index.js +62 -2990
- package/package.json +53 -44
- package/rollup.config.demo.js +30 -0
package/demo/index.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>CodeMirror Language Server Demo</title>
|
|
5
|
+
<link
|
|
6
|
+
type="text/css"
|
|
7
|
+
rel="stylesheet"
|
|
8
|
+
href="https://cdn.jsdelivr.net/gh/FurqanSoftware/sleek@v1.52.4/dist/sleek.css"
|
|
9
|
+
/>
|
|
10
|
+
</head>
|
|
11
|
+
<body class="p-1">
|
|
12
|
+
<div class="form__field br-1-4">
|
|
13
|
+
<div id="editor"></div>
|
|
14
|
+
</div>
|
|
15
|
+
<script type="module" src="./dist/demo.js"></script>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { EditorView, Tooltip
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Transport } from
|
|
1
|
+
import { EditorView, Tooltip } from '@codemirror/view';
|
|
2
|
+
import { CompletionTriggerKind } from 'vscode-languageserver-protocol';
|
|
3
|
+
import type { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
4
|
+
import type { PluginValue, ViewUpdate } from '@codemirror/view';
|
|
5
|
+
import { Transport } from '@open-rpc/client-js/build/transports/Transport';
|
|
6
|
+
import type { PublishDiagnosticsParams } from 'vscode-languageserver-protocol';
|
|
7
|
+
import type * as LSP from 'vscode-languageserver-protocol';
|
|
6
8
|
interface LSPEventMap {
|
|
7
|
-
|
|
9
|
+
'textDocument/publishDiagnostics': LSP.PublishDiagnosticsParams;
|
|
8
10
|
}
|
|
9
11
|
type Notification = {
|
|
10
12
|
[key in keyof LSPEventMap]: {
|
|
11
|
-
jsonrpc:
|
|
13
|
+
jsonrpc: '2.0';
|
|
12
14
|
id?: null | undefined;
|
|
13
15
|
method: key;
|
|
14
16
|
params: LSPEventMap[key];
|
|
15
17
|
};
|
|
16
18
|
}[keyof LSPEventMap];
|
|
17
|
-
declare class LanguageServerClient {
|
|
19
|
+
export declare class LanguageServerClient {
|
|
18
20
|
ready: boolean;
|
|
19
21
|
capabilities: LSP.ServerCapabilities<any>;
|
|
20
22
|
initializePromise: Promise<void>;
|
|
@@ -87,10 +89,10 @@ interface LanguageServerOptions extends LanguageServerClientOptions {
|
|
|
87
89
|
interface LanguageServerWebsocketOptions extends LanguageServerBaseOptions {
|
|
88
90
|
serverUri: `ws://${string}` | `wss://${string}`;
|
|
89
91
|
}
|
|
90
|
-
declare function languageServer(options: LanguageServerWebsocketOptions): ({
|
|
92
|
+
export declare function languageServer(options: LanguageServerWebsocketOptions): ({
|
|
91
93
|
extension: import("@codemirror/state").Extension;
|
|
92
94
|
} | readonly import("@codemirror/state").Extension[])[];
|
|
93
|
-
declare function languageServerWithTransport(options: LanguageServerOptions): ({
|
|
95
|
+
export declare function languageServerWithTransport(options: LanguageServerOptions): ({
|
|
94
96
|
extension: import("@codemirror/state").Extension;
|
|
95
97
|
} | readonly import("@codemirror/state").Extension[])[];
|
|
96
|
-
export {
|
|
98
|
+
export {};
|