@kerebron/extension-lsp 0.4.5 → 0.4.6
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/README.md +47 -157
- package/esm/{extension-lsp/src/DiagnosticPlugin.d.ts → DiagnosticPlugin.d.ts} +1 -1
- package/esm/DiagnosticPlugin.d.ts.map +1 -0
- package/esm/{extension-lsp/src/ExtensionLsp.d.ts → ExtensionLsp.d.ts} +3 -3
- package/esm/ExtensionLsp.d.ts.map +1 -0
- package/esm/{extension-lsp/src/ExtensionLsp.js → ExtensionLsp.js} +3 -3
- package/esm/LSPClient.d.ts.map +1 -0
- package/esm/{extension-lsp/src/LspWebSocketTransport.d.ts → LspWebSocketTransport.d.ts} +0 -1
- package/esm/LspWebSocketTransport.d.ts.map +1 -0
- package/esm/{extension-lsp/src/LspWebSocketTransport.js → LspWebSocketTransport.js} +0 -1
- package/esm/computeIncrementalChanges.d.ts.map +1 -0
- package/esm/{extension-lsp/src/createLspAutocomplete.d.ts → createLspAutocomplete.d.ts} +4 -4
- package/esm/createLspAutocomplete.d.ts.map +1 -0
- package/esm/{extension-lsp/src/createLspAutocomplete.js → createLspAutocomplete.js} +2 -2
- package/esm/{extension-lsp/src/mod.d.ts → mod.d.ts} +0 -1
- package/esm/mod.d.ts.map +1 -0
- package/esm/{extension-lsp/src/mod.js → mod.js} +0 -1
- package/esm/{extension-lsp/src/types.d.ts → types.d.ts} +0 -1
- package/esm/types.d.ts.map +1 -0
- package/esm/{extension-lsp/src/workspace.d.ts → workspace.d.ts} +2 -2
- package/esm/workspace.d.ts.map +1 -0
- package/package.json +9 -12
- package/assets/lsp-status.css +0 -60
- package/esm/_dnt.polyfills.d.ts +0 -101
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -127
- package/esm/_dnt.shims.d.ts +0 -2
- package/esm/_dnt.shims.d.ts.map +0 -1
- package/esm/_dnt.shims.js +0 -57
- package/esm/editor/src/CoreEditor.d.ts +0 -40
- package/esm/editor/src/CoreEditor.d.ts.map +0 -1
- package/esm/editor/src/CoreEditor.js +0 -252
- package/esm/editor/src/DummyEditorView.d.ts +0 -60
- package/esm/editor/src/DummyEditorView.d.ts.map +0 -1
- package/esm/editor/src/DummyEditorView.js +0 -277
- package/esm/editor/src/Extension.d.ts +0 -31
- package/esm/editor/src/Extension.d.ts.map +0 -1
- package/esm/editor/src/Extension.js +0 -53
- package/esm/editor/src/ExtensionManager.d.ts +0 -32
- package/esm/editor/src/ExtensionManager.d.ts.map +0 -1
- package/esm/editor/src/ExtensionManager.js +0 -260
- package/esm/editor/src/Mark.d.ts +0 -23
- package/esm/editor/src/Mark.d.ts.map +0 -1
- package/esm/editor/src/Mark.js +0 -51
- package/esm/editor/src/Node.d.ts +0 -32
- package/esm/editor/src/Node.d.ts.map +0 -1
- package/esm/editor/src/Node.js +0 -60
- package/esm/editor/src/commands/CommandManager.d.ts +0 -23
- package/esm/editor/src/commands/CommandManager.d.ts.map +0 -1
- package/esm/editor/src/commands/CommandManager.js +0 -118
- package/esm/editor/src/commands/baseCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/baseCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/baseCommandFactories.js +0 -836
- package/esm/editor/src/commands/createChainableState.d.ts +0 -3
- package/esm/editor/src/commands/createChainableState.d.ts.map +0 -1
- package/esm/editor/src/commands/createChainableState.js +0 -29
- package/esm/editor/src/commands/keyCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/keyCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/keyCommandFactories.js +0 -10
- package/esm/editor/src/commands/mod.d.ts +0 -7
- package/esm/editor/src/commands/mod.d.ts.map +0 -1
- package/esm/editor/src/commands/mod.js +0 -76
- package/esm/editor/src/commands/replaceCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/replaceCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/replaceCommandFactories.js +0 -94
- package/esm/editor/src/commands/types.d.ts +0 -18
- package/esm/editor/src/commands/types.d.ts.map +0 -1
- package/esm/editor/src/mod.d.ts +0 -9
- package/esm/editor/src/mod.d.ts.map +0 -1
- package/esm/editor/src/mod.js +0 -8
- package/esm/editor/src/nodeToTreeString.d.ts +0 -10
- package/esm/editor/src/nodeToTreeString.d.ts.map +0 -1
- package/esm/editor/src/nodeToTreeString.js +0 -74
- package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts +0 -6
- package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts.map +0 -1
- package/esm/editor/src/plugins/TrackSelecionPlugin.js +0 -24
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts +0 -23
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +0 -163
- package/esm/editor/src/plugins/keymap/keymap.d.ts +0 -11
- package/esm/editor/src/plugins/keymap/keymap.d.ts.map +0 -1
- package/esm/editor/src/plugins/keymap/keymap.js +0 -125
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +0 -4
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +0 -1
- package/esm/editor/src/plugins/keymap/w3c-keyname.js +0 -124
- package/esm/editor/src/types.d.ts +0 -52
- package/esm/editor/src/types.d.ts.map +0 -1
- package/esm/editor/src/types.js +0 -1
- package/esm/editor/src/ui.d.ts +0 -15
- package/esm/editor/src/ui.d.ts.map +0 -1
- package/esm/editor/src/ui.js +0 -16
- package/esm/editor/src/utilities/SmartOutput.d.ts +0 -41
- package/esm/editor/src/utilities/SmartOutput.d.ts.map +0 -1
- package/esm/editor/src/utilities/SmartOutput.js +0 -228
- package/esm/editor/src/utilities/createNodeFromContent.d.ts +0 -9
- package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +0 -1
- package/esm/editor/src/utilities/createNodeFromContent.js +0 -32
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts +0 -9
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +0 -1
- package/esm/editor/src/utilities/getHtmlAttributes.js +0 -47
- package/esm/editor/src/utilities/getShadowRoot.d.ts +0 -2
- package/esm/editor/src/utilities/getShadowRoot.d.ts.map +0 -1
- package/esm/editor/src/utilities/getShadowRoot.js +0 -16
- package/esm/editor/src/utilities/mod.d.ts +0 -6
- package/esm/editor/src/utilities/mod.d.ts.map +0 -1
- package/esm/editor/src/utilities/mod.js +0 -5
- package/esm/editor/src/utilities/toRawTextResult.d.ts +0 -3
- package/esm/editor/src/utilities/toRawTextResult.d.ts.map +0 -1
- package/esm/editor/src/utilities/toRawTextResult.js +0 -21
- package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts +0 -8
- package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/AutocompletePlugin.js +0 -232
- package/esm/extension-autocomplete/src/DefaultRenderer.d.ts +0 -17
- package/esm/extension-autocomplete/src/DefaultRenderer.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/DefaultRenderer.js +0 -137
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts +0 -26
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.js +0 -30
- package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts +0 -11
- package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/createDefaultMatcher.js +0 -58
- package/esm/extension-autocomplete/src/createRegexMatcher.d.ts +0 -4
- package/esm/extension-autocomplete/src/createRegexMatcher.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/createRegexMatcher.js +0 -50
- package/esm/extension-autocomplete/src/mod.d.ts +0 -3
- package/esm/extension-autocomplete/src/mod.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/mod.js +0 -2
- package/esm/extension-autocomplete/src/types.d.ts +0 -60
- package/esm/extension-autocomplete/src/types.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/types.js +0 -1
- package/esm/extension-basic-editor/src/ExtensionHtml.d.ts +0 -15
- package/esm/extension-basic-editor/src/ExtensionHtml.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/ExtensionHtml.js +0 -108
- package/esm/extension-lsp/src/DiagnosticPlugin.d.ts.map +0 -1
- package/esm/extension-lsp/src/ExtensionLsp.d.ts.map +0 -1
- package/esm/extension-lsp/src/LSPClient.d.ts.map +0 -1
- package/esm/extension-lsp/src/LspStatus.d.ts +0 -35
- package/esm/extension-lsp/src/LspStatus.d.ts.map +0 -1
- package/esm/extension-lsp/src/LspStatus.js +0 -128
- package/esm/extension-lsp/src/LspWebSocketTransport.d.ts.map +0 -1
- package/esm/extension-lsp/src/computeIncrementalChanges.d.ts.map +0 -1
- package/esm/extension-lsp/src/createLspAutocomplete.d.ts.map +0 -1
- package/esm/extension-lsp/src/mod.d.ts.map +0 -1
- package/esm/extension-lsp/src/types.d.ts.map +0 -1
- package/esm/extension-lsp/src/types.js +0 -1
- package/esm/extension-lsp/src/workspace.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts +0 -36
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.js +0 -240
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts +0 -26
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.js +0 -115
- package/esm/extension-markdown/src/ExtensionMarkdown.d.ts +0 -22
- package/esm/extension-markdown/src/ExtensionMarkdown.d.ts.map +0 -1
- package/esm/extension-markdown/src/ExtensionMarkdown.js +0 -48
- package/esm/extension-markdown/src/MarkdownParser.d.ts +0 -61
- package/esm/extension-markdown/src/MarkdownParser.d.ts.map +0 -1
- package/esm/extension-markdown/src/MarkdownParser.js +0 -249
- package/esm/extension-markdown/src/MarkdownSerializer.d.ts +0 -42
- package/esm/extension-markdown/src/MarkdownSerializer.d.ts.map +0 -1
- package/esm/extension-markdown/src/MarkdownSerializer.js +0 -325
- package/esm/extension-markdown/src/PositionMapper.d.ts +0 -15
- package/esm/extension-markdown/src/PositionMapper.d.ts.map +0 -1
- package/esm/extension-markdown/src/PositionMapper.js +0 -100
- package/esm/extension-markdown/src/TokenSource.d.ts +0 -11
- package/esm/extension-markdown/src/TokenSource.d.ts.map +0 -1
- package/esm/extension-markdown/src/TokenSource.js +0 -39
- package/esm/extension-markdown/src/mdToPmConverter.d.ts +0 -5
- package/esm/extension-markdown/src/mdToPmConverter.d.ts.map +0 -1
- package/esm/extension-markdown/src/mdToPmConverter.js +0 -111
- package/esm/extension-markdown/src/pmToMdConverter.d.ts +0 -16
- package/esm/extension-markdown/src/pmToMdConverter.d.ts.map +0 -1
- package/esm/extension-markdown/src/pmToMdConverter.js +0 -433
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts +0 -4
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.js +0 -151
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts +0 -3
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.js +0 -34
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts +0 -6
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.js +0 -380
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts +0 -3
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.js +0 -323
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts +0 -9
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.js +0 -308
- package/esm/extension-markdown/src/treeSitterTokenizer.d.ts +0 -5
- package/esm/extension-markdown/src/treeSitterTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/treeSitterTokenizer.js +0 -769
- package/esm/extension-markdown/src/types.d.ts +0 -28
- package/esm/extension-markdown/src/types.d.ts.map +0 -1
- package/esm/extension-markdown/src/types.js +0 -131
- package/esm/extension-markdown/src/utils.d.ts +0 -8
- package/esm/extension-markdown/src/utils.d.ts.map +0 -1
- package/esm/extension-markdown/src/utils.js +0 -86
- package/esm/extension-menu/src/CustomMenuPlugin.d.ts +0 -65
- package/esm/extension-menu/src/CustomMenuPlugin.d.ts.map +0 -1
- package/esm/extension-menu/src/CustomMenuPlugin.js +0 -1186
- package/esm/extension-menu/src/ExtensionCustomMenu.d.ts +0 -14
- package/esm/extension-menu/src/ExtensionCustomMenu.d.ts.map +0 -1
- package/esm/extension-menu/src/ExtensionCustomMenu.js +0 -57
- package/esm/extension-menu/src/buildMenu.d.ts +0 -5
- package/esm/extension-menu/src/buildMenu.d.ts.map +0 -1
- package/esm/extension-menu/src/buildMenu.js +0 -331
- package/esm/extension-menu/src/icons.d.ts +0 -15
- package/esm/extension-menu/src/icons.d.ts.map +0 -1
- package/esm/extension-menu/src/icons.js +0 -123
- package/esm/extension-menu/src/menu.d.ts +0 -81
- package/esm/extension-menu/src/menu.d.ts.map +0 -1
- package/esm/extension-menu/src/menu.js +0 -350
- package/esm/extension-menu/src/mod.d.ts +0 -3
- package/esm/extension-menu/src/mod.d.ts.map +0 -1
- package/esm/extension-menu/src/mod.js +0 -2
- package/esm/extension-menu/src/prompt.d.ts +0 -36
- package/esm/extension-menu/src/prompt.d.ts.map +0 -1
- package/esm/extension-menu/src/prompt.js +0 -158
- package/esm/extension-yjs/src/CollaborationStatus.d.ts +0 -59
- package/esm/extension-yjs/src/CollaborationStatus.d.ts.map +0 -1
- package/esm/extension-yjs/src/CollaborationStatus.js +0 -286
- package/esm/tree-sitter-shim/src/main.d.ts +0 -15
- package/esm/tree-sitter-shim/src/main.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/main.js +0 -25
- package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts +0 -6
- package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/node.js +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts +0 -7
- package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/parser.js +0 -5
- package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts +0 -6
- package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/tree.js +0 -1
- package/esm/wasm/src/mod.d.ts +0 -12
- package/esm/wasm/src/mod.d.ts.map +0 -1
- package/esm/wasm/src/mod.js +0 -48
- package/esm/wasm/wasm.d.ts +0 -138
- package/esm/wasm/wasm.d.ts.map +0 -1
- package/esm/wasm/wasm.js +0 -120
- /package/esm/{extension-lsp/src/DiagnosticPlugin.js → DiagnosticPlugin.js} +0 -0
- /package/esm/{extension-lsp/src/LSPClient.d.ts → LSPClient.d.ts} +0 -0
- /package/esm/{extension-lsp/src/LSPClient.js → LSPClient.js} +0 -0
- /package/esm/{extension-lsp/src/computeIncrementalChanges.d.ts → computeIncrementalChanges.d.ts} +0 -0
- /package/esm/{extension-lsp/src/computeIncrementalChanges.js → computeIncrementalChanges.js} +0 -0
- /package/esm/{editor/src/commands/types.js → types.js} +0 -0
- /package/esm/{extension-lsp/src/workspace.js → workspace.js} +0 -0
package/README.md
CHANGED
|
@@ -1,192 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Kerebron - Prosemirror based online editor kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Watch a Demo
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<a href="https://youtube.com/shorts/OdJjhAPj-wA?feature=share" target="_blank">
|
|
6
|
+
<img src="https://github.com/user-attachments/assets/b63ec84a-0ed2-4f98-920c-76f6d3215168" alt="Alt Text" width="200">
|
|
7
|
+
</a>
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- **WebSocket Transport**: Built-in WebSocket transport for browser-based connections
|
|
9
|
-
- **Autocomplete**: Get intelligent code completions from the language server
|
|
10
|
-
- **Diagnostics**: Display errors and warnings from the language server
|
|
11
|
-
- **Status Indicator**: Visual indicator showing LSP connection status in the toolbar
|
|
9
|
+
## Playground Demo
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
[playground](https://demo.kerebron.com) - be nice.
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
npm install @kerebron/extension-lsp
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
### Basic Setup
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
import { CoreEditor } from '@kerebron/editor';
|
|
25
|
-
import { ExtensionLsp, type LspTransportGetter, type Transport } from '@kerebron/extension-lsp';
|
|
26
|
-
import { LspWebSocketTransport } from '@kerebron/extension-lsp/LspWebSocketTransport';
|
|
27
|
-
|
|
28
|
-
// Import styles for the status indicator
|
|
29
|
-
import '@kerebron/extension-lsp/assets/lsp-status.css';
|
|
30
|
-
|
|
31
|
-
// Configure transport for different languages
|
|
32
|
-
const getLspTransport: LspTransportGetter = (lang: string): Transport | undefined => {
|
|
33
|
-
const baseUrl = 'ws://localhost:8000/lsp';
|
|
34
|
-
|
|
35
|
-
switch (lang) {
|
|
36
|
-
case 'markdown':
|
|
37
|
-
return new LspWebSocketTransport(`${baseUrl}/markdown`);
|
|
38
|
-
case 'typescript':
|
|
39
|
-
case 'javascript':
|
|
40
|
-
return new LspWebSocketTransport(`${baseUrl}/typescript`);
|
|
41
|
-
case 'json':
|
|
42
|
-
return new LspWebSocketTransport(`${baseUrl}/json`);
|
|
43
|
-
default:
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const editor = new CoreEditor({
|
|
49
|
-
element: document.getElementById('editor'),
|
|
50
|
-
uri: 'file:///document.md', // Required: LSP needs a file URI
|
|
51
|
-
extensions: [
|
|
52
|
-
// ... other extensions
|
|
53
|
-
new ExtensionLsp({ getLspTransport }),
|
|
54
|
-
],
|
|
55
|
-
});
|
|
56
|
-
```
|
|
13
|
+
## Overview
|
|
57
14
|
|
|
58
|
-
|
|
15
|
+
Using vanilla Prosemirror modules is often impossible because of
|
|
16
|
+
incompatibilities.
|
|
59
17
|
|
|
60
|
-
|
|
18
|
+
Kerebron forks several prosemirror projects into one monorepo in order to keep
|
|
19
|
+
them in sync.
|
|
61
20
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
import { ExtensionLsp } from '@kerebron/extension-lsp';
|
|
21
|
+
Project is inspired on https://tiptap.dev/, but instead of building wrapper
|
|
22
|
+
around a wrapper it borrows concept of extension and command manager.
|
|
65
23
|
|
|
66
|
-
|
|
67
|
-
|
|
24
|
+
It has simplified tooling (deno), fewer dependencies and resulting in lower
|
|
25
|
+
number of output npm modules.
|
|
68
26
|
|
|
69
|
-
|
|
70
|
-
element: document.getElementById('editor'),
|
|
71
|
-
uri: 'file:///document.md',
|
|
72
|
-
extensions: [
|
|
73
|
-
// ... other extensions
|
|
74
|
-
new ExtensionLsp({ getLspTransport }),
|
|
75
|
-
new ExtensionCustomMenu(), // Must come AFTER ExtensionLsp
|
|
76
|
-
],
|
|
77
|
-
});
|
|
78
|
-
```
|
|
27
|
+
**Work in progress**
|
|
79
28
|
|
|
80
|
-
The status indicator shows:
|
|
81
29
|
|
|
82
|
-
|
|
83
|
-
|--------|-----------|-------------|
|
|
84
|
-
| Connected | 🟢 Green dot | Successfully connected to LSP server |
|
|
85
|
-
| Connecting | 🟡 Yellow pulsing dot | Attempting to connect |
|
|
86
|
-
| Disconnected | 🔴 Red dot | Not connected to LSP server |
|
|
30
|
+
## Build
|
|
87
31
|
|
|
88
|
-
###
|
|
32
|
+
### Build static examples and `.wasm` files
|
|
89
33
|
|
|
90
|
-
```
|
|
91
|
-
|
|
34
|
+
```sh
|
|
35
|
+
deno task build
|
|
92
36
|
```
|
|
93
37
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
You can manually add the LSP status element for more control:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
import { LspStatusElement } from '@kerebron/extension-lsp/LspStatus';
|
|
38
|
+
## Development
|
|
100
39
|
|
|
101
|
-
|
|
40
|
+
To start example server:
|
|
102
41
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
trailingElements: [
|
|
106
|
-
new LspStatusElement({
|
|
107
|
-
lspExtension,
|
|
108
|
-
label: 'Language Server', // Custom label (default: 'LSP')
|
|
109
|
-
}),
|
|
110
|
-
],
|
|
111
|
-
});
|
|
42
|
+
```sh
|
|
43
|
+
deno task -f server-deno-hono start
|
|
112
44
|
```
|
|
113
45
|
|
|
114
|
-
##
|
|
115
|
-
|
|
116
|
-
### LspConfig
|
|
117
|
-
|
|
118
|
-
| Option | Type | Required | Description |
|
|
119
|
-
|--------|------|----------|-------------|
|
|
120
|
-
| `getLspTransport` | `LspTransportGetter` | Yes | Function that returns a transport for a given language |
|
|
121
|
-
|
|
122
|
-
### LspTransportGetter
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
type LspTransportGetter = (lang: string) => Transport | undefined;
|
|
126
|
-
```
|
|
46
|
+
## Examples
|
|
127
47
|
|
|
128
|
-
|
|
48
|
+
TODO
|
|
129
49
|
|
|
130
|
-
|
|
50
|
+
### NPM packages are generated using DNT
|
|
131
51
|
|
|
132
|
-
|
|
52
|
+
- https://deno.com/blog/publish-esm-cjs-module-dnt - the easiest way to publish
|
|
53
|
+
a hybrid npm module for ESM and CommonJS
|
|
54
|
+
- https://github.com/denoland/dnt
|
|
55
|
+
- https://gaubee.com/article/Publishing-Your-Deno-Project-as-a-Monorepo-using-dnt/
|
|
133
56
|
|
|
134
|
-
|
|
57
|
+
To generate npm packages
|
|
135
58
|
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const transport = new LspWebSocketTransport('ws://localhost:8000/lsp/typescript');
|
|
59
|
+
```sh
|
|
60
|
+
deno -A ./build/build_npm.ts
|
|
140
61
|
```
|
|
141
62
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Implement the `Transport` interface for custom transport mechanisms:
|
|
63
|
+
## Run through docker
|
|
145
64
|
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
disconnect(): void;
|
|
150
|
-
send(message: string): void;
|
|
151
|
-
onMessage(handler: (message: string) => void): void;
|
|
152
|
-
onError(handler: (error: Error) => void): void;
|
|
153
|
-
onClose(handler: () => void): void;
|
|
154
|
-
}
|
|
65
|
+
```sh
|
|
66
|
+
docker build . -t editor-test
|
|
67
|
+
docker run -it -p 8000:8000 -v $PWD:/usr/src/app editor-test
|
|
155
68
|
```
|
|
156
69
|
|
|
157
|
-
##
|
|
158
|
-
|
|
159
|
-
The LSP extension requires a server that proxies WebSocket connections to LSP servers. See the `server-deno-hono` example for a reference implementation.
|
|
70
|
+
## Prerequisites
|
|
160
71
|
|
|
161
|
-
|
|
72
|
+
Install deno
|
|
162
73
|
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
app.get('/lsp/markdown', upgradeWebSocket(() => {
|
|
166
|
-
return lspAdapter.upgradeWebSocket();
|
|
167
|
-
}));
|
|
168
|
-
|
|
169
|
-
// Proxy to TypeScript language server
|
|
170
|
-
app.get('/lsp/typescript', upgradeWebSocket(() => {
|
|
171
|
-
return proxyProcess('npx', ['typescript-language-server', '--stdio']);
|
|
172
|
-
}));
|
|
74
|
+
```
|
|
75
|
+
npm install -g deno
|
|
173
76
|
```
|
|
174
77
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
The status indicator uses the following CSS classes for customization:
|
|
178
|
-
|
|
179
|
-
| Class | Description |
|
|
180
|
-
|-------|-------------|
|
|
181
|
-
| `.kb-lsp-status` | Container element |
|
|
182
|
-
| `.kb-lsp-status__button` | Button wrapper |
|
|
183
|
-
| `.kb-lsp-status__dot` | Status dot indicator |
|
|
184
|
-
| `.kb-lsp-status__dot--connected` | Green connected state |
|
|
185
|
-
| `.kb-lsp-status__dot--connecting` | Yellow connecting state (pulsing) |
|
|
186
|
-
| `.kb-lsp-status__dot--disconnected` | Red disconnected state |
|
|
187
|
-
| `.kb-lsp-status__label` | Text label |
|
|
188
|
-
|
|
189
|
-
## Related
|
|
78
|
+
Install rust
|
|
190
79
|
|
|
191
|
-
|
|
192
|
-
|
|
80
|
+
```
|
|
81
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
82
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
2
|
import { ExtensionLsp } from './ExtensionLsp.js';
|
|
3
|
-
import { PositionMapper } from '
|
|
3
|
+
import { PositionMapper } from '@kerebron/extension-markdown/PositionMapper';
|
|
4
4
|
interface LspRange {
|
|
5
5
|
line: number;
|
|
6
6
|
character: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticPlugin.d.ts","sourceRoot":"","sources":["../src/DiagnosticPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QACL,KAAK,EAAE,QAAQ,CAAC;QAChB,GAAG,EAAE,QAAQ,CAAC;KACf,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,GAAG,CAAC;CACX;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,UAAU,gBAAgB;CACzB;AAID,qBAAa,gBAAiB,SAAQ,MAAM,CAAC,qBAAqB,CAAC;IACjE,YAAY,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACnD,kBAAkB,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACzD,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;gBAEzC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY;CA8J9D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
|
-
import { Extension } from '
|
|
3
|
-
import { type ExtensionMarkdown } from '
|
|
4
|
-
import { type ExtensionAutocomplete } from '
|
|
2
|
+
import { Extension } from '@kerebron/editor';
|
|
3
|
+
import { type ExtensionMarkdown } from '@kerebron/extension-markdown';
|
|
4
|
+
import { type ExtensionAutocomplete } from '@kerebron/extension-autocomplete';
|
|
5
5
|
import { LSPClient, Transport } from './LSPClient.js';
|
|
6
6
|
import { LspSource } from './workspace.js';
|
|
7
7
|
export type LspTransportGetter = (lang: string) => Transport | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionLsp.d.ts","sourceRoot":"","sources":["../src/ExtensionLsp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,kBAAkB,CAAC;CACrC;AAED,qBAAa,YAAa,SAAQ,SAAS;cASV,MAAM,EAAE,SAAS;IARhD,IAAI,SAAS;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAM;IACxC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,iBAAiB,EAAG,iBAAiB,CAAC;IACtC,qBAAqB,EAAG,qBAAqB,CAAC;IAC9C,QAAQ,EAAE,MAAM,CAAc;IAC9B,MAAM,EAAG,SAAS,CAAC;gBAEY,MAAM,EAAE,SAAS;IAIvC,qBAAqB,IAAI,MAAM,EAAE;IAWjC,OAAO;IA6DhB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;CAW/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Extension } from '
|
|
2
|
-
import { PositionMapper } from '
|
|
1
|
+
import { Extension } from '@kerebron/editor';
|
|
2
|
+
import { PositionMapper } from '@kerebron/extension-markdown/PositionMapper';
|
|
3
3
|
import { LSPClient } from './LSPClient.js';
|
|
4
|
-
import { AutocompletePlugin } from '
|
|
4
|
+
import { AutocompletePlugin } from '@kerebron/extension-autocomplete/AutocompletePlugin';
|
|
5
5
|
import { DiagnosticPlugin } from './DiagnosticPlugin.js';
|
|
6
6
|
import { createLspAutocomplete } from './createLspAutocomplete.js';
|
|
7
7
|
export class ExtensionLsp extends Extension {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LSPClient.d.ts","sourceRoot":"","sources":["../src/LSPClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAEL,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAEL,SAAS,EACT,SAAS,EACT,aAAa,EACd,MAAM,gBAAgB,CAAC;AA0BxB,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,IAAI,IAAI,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;IACnB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAC;IACR,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,GAAG,IAAI,EACnD,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,GACvC,IAAI,CAAC;IACR,WAAW,IAAI,OAAO,CAAC;IACvB,aAAa,IAAI,OAAO,CAAC;CAC1B,CAAC;AAiEF,MAAM,MAAM,eAAe,GAAG;IAE5B,OAAO,CAAC,EAAE,MAAM,CAAC;IAMjB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,CAAC;IAG7C,OAAO,CAAC,EAAE,MAAM,CAAC;IAOjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAGxC,qBAAqB,CAAC,EAAE,CACtB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,GAAG,KACR,IAAI,CAAC;CACX,CAAC;AAEF,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAS,UAAS;IAClB,QAAQ,CAAC,KAAK,QAAQ;IAEtB,MAAM,CAAC,aAAa;CAKrB;AAED,qBAAa,SAAU,SAAQ,WAAW;IAiBtC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,QAAQ,CAAC,MAAM,EAAE,eAAe;IAjBlC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAM;IAExC,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,QAAQ,CAAsB;IAEtC,kBAAkB,EAAE,GAAG,CAAC,kBAAkB,GAAG,IAAI,CAAQ;IAClD,WAAW,EAAE,oBAAoB,CAA6B;IAErE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,YAAY,CAA6C;IAEjE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqC;IACrE,MAAM,EAAE,OAAO,CAAS;gBAGL,SAAS,EAAE,SAAS,EAC5B,MAAM,GAAE,eAAoB;IAuCvC,iBAAiB;IAoCjB,gBAAgB;IAOV,OAAO;IASb,aAAa;IAQb,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;IAWtC,UAAU,CAAC,GAAG,EAAE,MAAM;IAahB,OAAO,CAAC,IAAI,EAAE,aAAa;IAmBjC,QAAQ,CAAC,GAAG,EAAE,MAAM;IASpB,OAAO,CAAC,cAAc;IA+ChB,OAAO,CAAC,MAAM,EAAE,MAAM,EAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC;IAalB,OAAO,CAAC,YAAY;IA8Cd,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB5E,aAAa,CAAC,MAAM,EAAE,GAAG;IAOzB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,kBAAkB;IAIhD,IAAI;IAIJ,OAAO,CAAC,cAAc;CAcvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LspWebSocketTransport.d.ts","sourceRoot":"","sources":["../src/LspWebSocketTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAShD,qBAAa,qBAAsB,SAAQ,WAAY,YAAW,SAAS;aAQ7C,GAAG,EAAE,MAAM;IAPvC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,YAAY,EAAE,OAAO,CAAS;IAC9B,WAAW,UAAS;gBAEQ,GAAG,EAAE,MAAM;IAIvC,WAAW;IAIX,aAAa;IAIb,OAAO;IAWP,UAAU,IAAI,IAAI;IAQlB,UAAU,CAAC,MAAM,EAAE,SAAS;IAqC5B,iBAAiB;IAiBjB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAW5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeIncrementalChanges.d.ts","sourceRoot":"","sources":["../src/computeIncrementalChanges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,GAAG,CAAC,8BAA8B,EAAE,CA0FtC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DefaultRenderer } from '
|
|
2
|
-
import { TextRange } from '
|
|
3
|
-
import { type AutocompleteProps } from '
|
|
1
|
+
import { DefaultRenderer } from '@kerebron/extension-autocomplete/DefaultRenderer';
|
|
2
|
+
import { TextRange } from '@kerebron/editor';
|
|
3
|
+
import { type AutocompleteProps } from '@kerebron/extension-autocomplete';
|
|
4
4
|
import { ExtensionLsp } from './ExtensionLsp.js';
|
|
5
5
|
interface CompletionItem {
|
|
6
6
|
label: string;
|
|
@@ -14,7 +14,7 @@ export declare function cleanPlaceholders(input: string): string;
|
|
|
14
14
|
export declare function createLspAutocomplete(extensionLsp: ExtensionLsp): {
|
|
15
15
|
autocompleteConfig: {
|
|
16
16
|
renderer: CustomRenderer;
|
|
17
|
-
matchers:
|
|
17
|
+
matchers: any[];
|
|
18
18
|
getItems: (query: string, props: AutocompleteProps) => Promise<CompletionItem[]>;
|
|
19
19
|
onSelect: (selected: CompletionItem, range: TextRange) => Promise<void>;
|
|
20
20
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLspAutocomplete.d.ts","sourceRoot":"","sources":["../src/createLspAutocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAmB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAe,SAAQ,eAAe,CAAC,cAAc,CAAC;IACxD,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM;CAa1D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY;;;;0BAOpC,MAAM,SAAS,iBAAiB;6BAiC7B,cAAc,SAAS,SAAS;;EAiB9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefaultRenderer } from '
|
|
2
|
-
import { createRegexMatcher, } from '
|
|
1
|
+
import { DefaultRenderer } from '@kerebron/extension-autocomplete/DefaultRenderer';
|
|
2
|
+
import { createRegexMatcher, } from '@kerebron/extension-autocomplete';
|
|
3
3
|
export class CustomRenderer extends DefaultRenderer {
|
|
4
4
|
createListItem(item, cnt) {
|
|
5
5
|
const li = document.createElement('li');
|
package/esm/mod.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as lsp from 'vscode-languageserver-protocol';
|
|
2
|
-
import type { EditorUi } from '
|
|
2
|
+
import type { EditorUi } from '@kerebron/editor';
|
|
3
3
|
import { LSPClient } from './LSPClient.js';
|
|
4
|
-
import { PositionMapper } from '
|
|
4
|
+
import { PositionMapper } from '@kerebron/extension-markdown/PositionMapper';
|
|
5
5
|
export interface LspSource {
|
|
6
6
|
ui: EditorUi;
|
|
7
7
|
getMappedContent(): {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAG3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAG7E,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,QAAQ,CAAC;IACb,gBAAgB,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,CAAA;KAAE,CAAC;CACjE;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,IAAI,QAAQ,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC,8BAA8B,EAAE,CAAC;CAC/C;AAED,8BAAsB,SAAS;IAK3B,QAAQ,CAAC,MAAM,EAAE,SAAS;IAJ5B,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAChC,SAAS,CAAC,WAAW,UAAS;gBAGnB,MAAM,EAAE,SAAS;IAG5B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAI1C,QAAQ,CAAC,SAAS,IAAI,SAAS,mBAAmB,EAAE;IAEpD,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIvD,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;IAC3E,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IACvC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAE/B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC,YAAY,IAAI,IAAI;IAOpB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;CAIlD;AAED,cAAM,oBAAqB,YAAW,aAAa;IAG/C,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM;IACpB,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,SAAS;IAPnB,aAAa,EAAE,MAAM,CAAM;gBAEvB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,SAAS;IAI1B,KAAK;CAGN;AAED,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,KAAK,EAAE,oBAAoB,EAAE,CAAM;IACnC,OAAO,CAAC,YAAY,CAAkD;IAEtE,eAAe,CAAC,GAAG,EAAE,MAAM;IAI3B,SAAS;IAaH,WAAW,CAAC,GAAG,EAAE,MAAM;IAkC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;IAsB3D,SAAS,CAAC,GAAG,EAAE,MAAM;CAOtB"}
|
package/package.json
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/extension-lsp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"module": "./esm/
|
|
5
|
+
"module": "./esm/mod.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"import": "./esm/
|
|
8
|
+
"import": "./esm/mod.js"
|
|
9
9
|
},
|
|
10
10
|
"./types": {
|
|
11
|
-
"import": "./esm/
|
|
11
|
+
"import": "./esm/types.js"
|
|
12
12
|
},
|
|
13
13
|
"./LspWebSocketTransport": {
|
|
14
|
-
"import": "./esm/
|
|
15
|
-
},
|
|
16
|
-
"./LspStatus": {
|
|
17
|
-
"import": "./esm/extension-lsp/src/LspStatus.js"
|
|
14
|
+
"import": "./esm/LspWebSocketTransport.js"
|
|
18
15
|
}
|
|
19
16
|
},
|
|
20
17
|
"scripts": {},
|
|
21
18
|
"dependencies": {
|
|
22
|
-
"
|
|
19
|
+
"@kerebron/editor": "0.4.6",
|
|
20
|
+
"@kerebron/extension-autocomplete": "0.4.6",
|
|
21
|
+
"@kerebron/extension-markdown": "0.4.6",
|
|
23
22
|
"prosemirror-state": "1.4.3",
|
|
24
|
-
"prosemirror-transform": "1.10.4",
|
|
25
23
|
"prosemirror-view": "1.40.0",
|
|
26
|
-
"vscode-languageserver-protocol": "3.17.5"
|
|
27
|
-
"web-tree-sitter": "0.24.7"
|
|
24
|
+
"vscode-languageserver-protocol": "3.17.5"
|
|
28
25
|
},
|
|
29
26
|
"devDependencies": {
|
|
30
27
|
"@types/node": "^20.9.0"
|
package/assets/lsp-status.css
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* LSP Status Menu Element */
|
|
2
|
-
.kb-lsp-status {
|
|
3
|
-
position: relative;
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.kb-lsp-status__indicator {
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 0.35rem;
|
|
12
|
-
padding: 0.35rem 0.6rem;
|
|
13
|
-
border: 1px solid var(--kb-border, #444);
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
background: var(--kb-surface, #2a2a2a);
|
|
16
|
-
color: var(--kb-text, #e8e8e8);
|
|
17
|
-
font-size: 0.85rem;
|
|
18
|
-
cursor: default;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Status dot indicator */
|
|
22
|
-
.kb-lsp-status__dot {
|
|
23
|
-
width: 8px;
|
|
24
|
-
height: 8px;
|
|
25
|
-
border-radius: 50%;
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.kb-lsp-status__dot--connected {
|
|
30
|
-
background-color: #22c55e;
|
|
31
|
-
box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.kb-lsp-status__dot--connecting {
|
|
35
|
-
background-color: #eab308;
|
|
36
|
-
box-shadow: 0 0 4px rgba(234, 179, 8, 0.5);
|
|
37
|
-
animation: kb-lsp-pulse 1.5s ease-in-out infinite;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.kb-lsp-status__dot--disconnected {
|
|
41
|
-
background-color: #ef4444;
|
|
42
|
-
box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@keyframes kb-lsp-pulse {
|
|
46
|
-
0%, 100% {
|
|
47
|
-
opacity: 1;
|
|
48
|
-
}
|
|
49
|
-
50% {
|
|
50
|
-
opacity: 0.5;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Label */
|
|
55
|
-
.kb-lsp-status__label {
|
|
56
|
-
font-weight: 500;
|
|
57
|
-
font-size: 0.8rem;
|
|
58
|
-
text-transform: uppercase;
|
|
59
|
-
letter-spacing: 0.03em;
|
|
60
|
-
}
|
package/esm/_dnt.polyfills.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
-
* but instead of using npm to install additional dependencies,
|
|
4
|
-
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
-
*
|
|
6
|
-
* Note that this code might be imported multiple times
|
|
7
|
-
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
-
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
-
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
-
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
-
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
-
*/
|
|
13
|
-
import { createRequire } from "node:module";
|
|
14
|
-
import { type URL } from "node:url";
|
|
15
|
-
declare global {
|
|
16
|
-
interface ImportMeta {
|
|
17
|
-
/** A string representation of the fully qualified module URL. When the
|
|
18
|
-
* module is loaded locally, the value will be a file URL (e.g.
|
|
19
|
-
* `file:///path/module.ts`).
|
|
20
|
-
*
|
|
21
|
-
* You can also parse the string as a URL to determine more information about
|
|
22
|
-
* how the current module was loaded. For example to determine if a module was
|
|
23
|
-
* local or not:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* const url = new URL(import.meta.url);
|
|
27
|
-
* if (url.protocol === "file:") {
|
|
28
|
-
* console.log("this module was loaded locally");
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
url: string;
|
|
33
|
-
/**
|
|
34
|
-
* A function that returns resolved specifier as if it would be imported
|
|
35
|
-
* using `import(specifier)`.
|
|
36
|
-
*
|
|
37
|
-
* ```ts
|
|
38
|
-
* console.log(import.meta.resolve("./foo.js"));
|
|
39
|
-
* // file:///dev/foo.js
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @param specifier The module specifier to resolve relative to `parent`.
|
|
43
|
-
* @param parent The absolute parent module URL to resolve from.
|
|
44
|
-
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
45
|
-
*/
|
|
46
|
-
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
47
|
-
/** A flag that indicates if the current module is the main module that was
|
|
48
|
-
* called when starting the program under Deno.
|
|
49
|
-
*
|
|
50
|
-
* ```ts
|
|
51
|
-
* if (import.meta.main) {
|
|
52
|
-
* // this was loaded as the main module, maybe do some bootstrapping
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
main: boolean;
|
|
57
|
-
/** The absolute path of the current module.
|
|
58
|
-
*
|
|
59
|
-
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
60
|
-
*
|
|
61
|
-
* Example:
|
|
62
|
-
* ```
|
|
63
|
-
* // Unix
|
|
64
|
-
* console.log(import.meta.filename); // /home/alice/my_module.ts
|
|
65
|
-
*
|
|
66
|
-
* // Windows
|
|
67
|
-
* console.log(import.meta.filename); // C:\alice\my_module.ts
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
filename: string;
|
|
71
|
-
/** The absolute path of the directory containing the current module.
|
|
72
|
-
*
|
|
73
|
-
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
74
|
-
*
|
|
75
|
-
* * Example:
|
|
76
|
-
* ```
|
|
77
|
-
* // Unix
|
|
78
|
-
* console.log(import.meta.dirname); // /home/alice
|
|
79
|
-
*
|
|
80
|
-
* // Windows
|
|
81
|
-
* console.log(import.meta.dirname); // C:\alice
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
dirname: string;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
type NodeRequest = ReturnType<typeof createRequire>;
|
|
88
|
-
type NodeModule = NonNullable<NodeRequest["main"]>;
|
|
89
|
-
interface ImportMetaPonyfillCommonjs {
|
|
90
|
-
(require: NodeRequest, module: NodeModule): ImportMeta;
|
|
91
|
-
}
|
|
92
|
-
interface ImportMetaPonyfillEsmodule {
|
|
93
|
-
(importMeta: ImportMeta): ImportMeta;
|
|
94
|
-
}
|
|
95
|
-
interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
|
|
96
|
-
}
|
|
97
|
-
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
98
|
-
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
99
|
-
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
100
|
-
export {};
|
|
101
|
-
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
|