codemirror-languageserver 1.20.0 → 1.22.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/README.md +23 -1
- package/dist/index.js +40 -29
- package/dist/jsonrpc.d.ts +4 -0
- package/dist/plugin.d.ts +4 -2
- package/{demo/dist/demo.js → docs/dist/gh-pages.js} +4670 -3427
- package/docs/dist/lsp-worker.js +653 -0
- package/docs/gh-pages.js +115 -0
- package/docs/index.html +459 -0
- package/docs/lsp-worker.js +635 -0
- package/docs/worker-transport.js +50 -0
- package/package.json +5 -5
- package/rollup.config.gh-pages.js +34 -0
- package/demo/demo.js +0 -109
- package/demo/index.html +0 -17
- package/rollup.config.demo.js +0 -30
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codemirror-languageserver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Language Server Plugin for CodeMirror 6",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"prepare": "rollup -c rollup.config.js"
|
|
8
|
+
"prepare": "rollup -c rollup.config.js",
|
|
9
|
+
"build:gh-pages": "rollup -c rollup.config.gh-pages.js"
|
|
9
10
|
},
|
|
10
11
|
"author": {
|
|
11
12
|
"name": "Mahmud Ridwan",
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
"@babel/core": "^7.28.0",
|
|
26
27
|
"@babel/preset-env": "^7.28.0",
|
|
27
28
|
"@codemirror/commands": "^6.8.1",
|
|
28
|
-
"@codemirror/lang-
|
|
29
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
30
|
+
"@codemirror/language": "^6.11.2",
|
|
29
31
|
"@codemirror/search": "^6.5.11",
|
|
30
32
|
"@rollup/plugin-babel": "^6.0.4",
|
|
31
33
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
@@ -33,8 +35,6 @@
|
|
|
33
35
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
34
36
|
"prettier": "^3.6.2",
|
|
35
37
|
"rollup": "^4.46.2",
|
|
36
|
-
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
37
|
-
"rollup-plugin-serve": "^3.0.0",
|
|
38
38
|
"tslib": "^2.8.1",
|
|
39
39
|
"tslint": "^6.1.3",
|
|
40
40
|
"typescript": "^5.9.2"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import babel from '@rollup/plugin-babel';
|
|
2
|
+
import typescript from '@rollup/plugin-typescript';
|
|
3
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
4
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
input: 'docs/gh-pages.js',
|
|
9
|
+
output: {
|
|
10
|
+
file: 'docs/dist/gh-pages.js',
|
|
11
|
+
format: 'es',
|
|
12
|
+
},
|
|
13
|
+
plugins: [
|
|
14
|
+
typescript({
|
|
15
|
+
declaration: false,
|
|
16
|
+
}),
|
|
17
|
+
babel({
|
|
18
|
+
babelHelpers: 'bundled',
|
|
19
|
+
}),
|
|
20
|
+
nodeResolve({
|
|
21
|
+
browser: true,
|
|
22
|
+
}),
|
|
23
|
+
commonjs(),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
input: 'docs/lsp-worker.js',
|
|
28
|
+
output: {
|
|
29
|
+
file: 'docs/dist/lsp-worker.js',
|
|
30
|
+
format: 'es',
|
|
31
|
+
},
|
|
32
|
+
plugins: [nodeResolve(), commonjs()],
|
|
33
|
+
},
|
|
34
|
+
];
|
package/demo/demo.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EditorView,
|
|
3
|
-
highlightSpecialChars,
|
|
4
|
-
drawSelection,
|
|
5
|
-
highlightActiveLine,
|
|
6
|
-
keymap,
|
|
7
|
-
lineNumbers,
|
|
8
|
-
panels,
|
|
9
|
-
rectangularSelection,
|
|
10
|
-
} from '@codemirror/view';
|
|
11
|
-
import { EditorState, Compartment } from '@codemirror/state';
|
|
12
|
-
import {
|
|
13
|
-
indentOnInput,
|
|
14
|
-
indentUnit,
|
|
15
|
-
bracketMatching,
|
|
16
|
-
foldGutter,
|
|
17
|
-
foldKeymap,
|
|
18
|
-
defaultHighlightStyle,
|
|
19
|
-
syntaxHighlighting,
|
|
20
|
-
} from '@codemirror/language';
|
|
21
|
-
import {
|
|
22
|
-
defaultKeymap,
|
|
23
|
-
indentWithTab,
|
|
24
|
-
history,
|
|
25
|
-
historyKeymap,
|
|
26
|
-
} from '@codemirror/commands';
|
|
27
|
-
import { highlightSelectionMatches, searchKeymap } from '@codemirror/search';
|
|
28
|
-
import {
|
|
29
|
-
completionKeymap,
|
|
30
|
-
closeBrackets,
|
|
31
|
-
closeBracketsKeymap,
|
|
32
|
-
} from '@codemirror/autocomplete';
|
|
33
|
-
import { lintKeymap } from '@codemirror/lint';
|
|
34
|
-
import { cpp } from '@codemirror/lang-cpp';
|
|
35
|
-
import { languageServer } from '../src';
|
|
36
|
-
|
|
37
|
-
const tabSizeCompartment = new Compartment();
|
|
38
|
-
|
|
39
|
-
const doc = `#include <iostream>
|
|
40
|
-
|
|
41
|
-
using namespace std;
|
|
42
|
-
|
|
43
|
-
class Animal {
|
|
44
|
-
public:
|
|
45
|
-
void say(string call) {
|
|
46
|
-
cout << call << endl;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
class Cat : Animal {
|
|
51
|
-
public:
|
|
52
|
-
void meow() {
|
|
53
|
-
this->say("meow");
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
int main() {
|
|
58
|
-
Cat cat;
|
|
59
|
-
cat.meow();
|
|
60
|
-
return 0;
|
|
61
|
-
}
|
|
62
|
-
`
|
|
63
|
-
|
|
64
|
-
const view = new EditorView({
|
|
65
|
-
doc,
|
|
66
|
-
parent: document.getElementById('editor'),
|
|
67
|
-
extensions: [
|
|
68
|
-
lineNumbers(),
|
|
69
|
-
highlightSpecialChars(),
|
|
70
|
-
history(),
|
|
71
|
-
foldGutter(),
|
|
72
|
-
drawSelection(),
|
|
73
|
-
EditorState.allowMultipleSelections.of(true),
|
|
74
|
-
indentOnInput(),
|
|
75
|
-
indentUnit.of('\t'),
|
|
76
|
-
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
|
|
77
|
-
bracketMatching(),
|
|
78
|
-
closeBrackets(),
|
|
79
|
-
rectangularSelection(),
|
|
80
|
-
highlightActiveLine(),
|
|
81
|
-
highlightSelectionMatches(),
|
|
82
|
-
panels(),
|
|
83
|
-
keymap.of([
|
|
84
|
-
...closeBracketsKeymap,
|
|
85
|
-
...defaultKeymap,
|
|
86
|
-
indentWithTab,
|
|
87
|
-
...searchKeymap,
|
|
88
|
-
...historyKeymap,
|
|
89
|
-
...foldKeymap,
|
|
90
|
-
...completionKeymap,
|
|
91
|
-
...lintKeymap,
|
|
92
|
-
]),
|
|
93
|
-
tabSizeCompartment.of(EditorState.tabSize.of(4)),
|
|
94
|
-
cpp(),
|
|
95
|
-
languageServer({
|
|
96
|
-
serverUri: 'ws://localhost:3000/?stack=clangd11',
|
|
97
|
-
allowHTMLContent: true,
|
|
98
|
-
rootUri: 'file:///demo',
|
|
99
|
-
workspaceFolders: [
|
|
100
|
-
{
|
|
101
|
-
name: 'root',
|
|
102
|
-
uri: 'file:///demo',
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
documentUri: `file:///demo/main.cpp`,
|
|
106
|
-
languageId: 'cpp',
|
|
107
|
-
}),
|
|
108
|
-
],
|
|
109
|
-
});
|
package/demo/index.html
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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/rollup.config.demo.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import babel from '@rollup/plugin-babel';
|
|
2
|
-
import typescript from '@rollup/plugin-typescript';
|
|
3
|
-
import serve from 'rollup-plugin-serve';
|
|
4
|
-
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
5
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
6
|
-
import nodePolyfills from 'rollup-plugin-node-polyfills';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
input: 'demo/demo.js',
|
|
10
|
-
output: {
|
|
11
|
-
dir: 'demo/dist',
|
|
12
|
-
format: 'es',
|
|
13
|
-
intro: 'const global = window;',
|
|
14
|
-
},
|
|
15
|
-
plugins: [
|
|
16
|
-
typescript({
|
|
17
|
-
declaration: false,
|
|
18
|
-
}),
|
|
19
|
-
babel({
|
|
20
|
-
babelHelpers: 'bundled',
|
|
21
|
-
}),
|
|
22
|
-
nodeResolve({
|
|
23
|
-
browser: true,
|
|
24
|
-
preferBuiltins: true,
|
|
25
|
-
}),
|
|
26
|
-
commonjs(),
|
|
27
|
-
nodePolyfills(),
|
|
28
|
-
serve('./demo'),
|
|
29
|
-
],
|
|
30
|
-
};
|