Skip to content
This repository was archived by the owner on Mar 22, 2024. It is now read-only.

Commit ae25843

Browse files
committed
Updated to monaco-languageclient 6.5.3 / monaco-vscode-api 1.82.5
1 parent 52919f2 commit ae25843

File tree

14 files changed

+153
-141
lines changed

14 files changed

+153
-141
lines changed

Diff for: index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h2>Monaco Editor Wrapper</h2>
2929
<br>
3030
<a href="./packages/examples/wrapper_langium.html">Langium Grammar DSL Language Client & Language Server (Worker)</a>
3131
<br><br>
32-
Please execute <b><code>npm run start:example:server:json</code></b> beforehand:<br>
32+
Please execute <b><code>npm run start:examples:server:json</code></b> beforehand:<br>
3333
<a href="./packages/examples/wrapper_ws.html">Language Client & Web Socket Language Server example</a>
3434
<br>
3535

@@ -39,7 +39,7 @@ <h2>Monaco Editor React</h2>
3939
<a href="./packages/examples/react_ts.html">TypeScript Editor Worker</a>
4040
<br>
4141
<br>
42-
Please execute <b><code>npm run start:example:server:python</code></b> beforehand:<br>
42+
Please execute <b><code>npm run start:examples:server:python</code></b> beforehand:<br>
4343
<a href="./packages/examples/react_python.html">Python Language Client & Language Server</a>
4444
<br>
4545

Diff for: package-lock.json

+93-103
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"test": "vitest -c vitest.config.ts",
1414
"release:prepare": "npm run reset:repo && npm ci && npm run lint && npm run build",
1515
"reset:repo": "git clean -f -X -d",
16-
"start:example:server:json": "npm run start:server:json --workspace packages/examples",
17-
"start:example:server:python": "npm run start:server:python --workspace packages/examples"
16+
"start:examples:server:json": "npm run start:server:json --workspace packages/examples",
17+
"start:examples:server:python": "npm run start:server:python --workspace packages/examples"
1818
},
1919
"devDependencies": {
2020
"@types/node": "~18.18.3",

Diff for: packages/examples/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this npm module are documented in this file.
44

5+
## 2023-09-11
6+
7+
- Adjust to underlying api changes (`monaco-vscode-api` and `monaco-languageclient`)
8+
- Fix json language server lauch
9+
- Move python language server port to 30001 and json language server port to 30000
10+
511
## 2023-09-21
612

713
- Langium example allows to use semantic highlighting with monarch grammars (monaco-editor classic mode)

Diff for: packages/examples/package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
"version": "0.0.0",
55
"type": "module",
66
"dependencies": {
7-
"@codingame/monaco-vscode-editor-service-override": "~1.82.4",
8-
"@codingame/monaco-vscode-configuration-service-override": "~1.82.4",
9-
"@codingame/monaco-vscode-json-default-extension": "~1.82.4",
10-
"@codingame/monaco-vscode-keybindings-service-override": "~1.82.4",
11-
"@codingame/monaco-vscode-python-default-extension": "~1.82.4",
12-
"@typefox/monaco-editor-react": "~2.2.5",
7+
"@codingame/monaco-vscode-configuration-service-override": "~1.82.5",
8+
"@codingame/monaco-vscode-editor-service-override": "~1.82.5",
9+
"@codingame/monaco-vscode-json-default-extension": "~1.82.5",
10+
"@codingame/monaco-vscode-keybindings-service-override": "~1.82.5",
11+
"@codingame/monaco-vscode-python-default-extension": "~1.82.5",
12+
"@typefox/monaco-editor-react": "~2.3.0-next.2",
1313
"http-server": "~14.1.1",
1414
"langium": "~2.0.2",
1515
"langium-statemachine-dsl": "~2.0.0",
16-
"monaco-languageclient-examples": "~6.5.2",
16+
"monaco-languageclient-examples": "~6.5.3",
1717
"monaco-editor-workers": "~0.43.0",
18+
"monaco-editor-wrapper": "~3.3.0-next.2",
1819
"react": "~18.2.0",
1920
"react-dom": "~18.2.0",
2021
"request-light": "~0.7.0",

Diff for: packages/examples/src/langium/wrapperLangium.ts

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const run = async () => {
2626
export const startLangiumClientExtended = async () => {
2727
try {
2828
if (checkStarted()) return;
29+
disableButton('button-start-classic');
2930
const config = await setupLangiumClientExtended();
3031
wrapper = new MonacoEditorLanguageClientWrapper();
3132
wrapper.start(config, htmlElement);
@@ -37,6 +38,7 @@ export const startLangiumClientExtended = async () => {
3738
export const startLangiumClientClassic = async () => {
3839
try {
3940
if (checkStarted()) return;
41+
disableButton('button-start-extended');
4042
const config = await setupLangiumClientClassic();
4143
wrapper = new MonacoEditorLanguageClientWrapper();
4244
await wrapper.start(config, htmlElement!);
@@ -53,6 +55,13 @@ const checkStarted = () => {
5355
return false;
5456
};
5557

58+
const disableButton = (id: string) => {
59+
const button = document.getElementById(id) as HTMLButtonElement;
60+
if (button !== null) {
61+
button.disabled = true;
62+
}
63+
};
64+
5665
export const disposeEditor = async () => {
5766
if (!wrapper) return;
5867
wrapper.reportStatus();

Diff for: packages/examples/src/reactPython.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const userConfig: UserConfig = {
2323
name: 'Python Language Server Example',
2424
$type: 'WebSocket',
2525
host: 'localhost',
26-
port: 30000,
26+
port: 30001,
2727
path: 'pyright',
2828
extraParams: {
2929
authorization: 'UserAuth'

Diff for: packages/examples/src/servers/json-server.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
import { runJsonServer } from 'monaco-languageclient-examples/node';
1+
import { resolve } from 'path';
2+
import { getLocalDirectory, runJsonServer } from 'monaco-languageclient-examples/node';
23

3-
runJsonServer();
4+
const baseDir = resolve(getLocalDirectory(import.meta.url));
5+
const relativeDir = '../../../../node_modules/monaco-languageclient-examples/dist/json/server/json-server.js';
6+
runJsonServer(baseDir, relativeDir);

Diff for: packages/examples/src/wrapperAdvanced.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Same again.`
3737
$type: 'WebSocket',
3838
name: 'wrapper42 language client',
3939
host: 'localhost',
40-
port: 3000,
40+
port: 30000,
4141
path: 'sampleServer',
4242
secured: false
4343
}

Diff for: packages/examples/src/wrapperWs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const userConfig: UserConfig = {
4444
languageClientConfig: {
4545
options: {
4646
$type: 'WebSocketUrl',
47-
url: 'ws://localhost:3000/sampleServer',
47+
url: 'ws://localhost:30000/sampleServer',
4848
startOptions: {
4949
onCall: () => {
5050
console.log('Connected to socket.');

Diff for: packages/monaco-editor-react/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typefox/monaco-editor-react",
3-
"version": "2.3.0-next.0",
3+
"version": "2.3.0-next.2",
44
"license": "MIT",
55
"description": "React component for Monaco-Editor and Monaco Languageclient",
66
"keywords": [
@@ -50,7 +50,7 @@
5050
"npm": "9.8.1"
5151
},
5252
"peerDependencies": {
53-
"monaco-editor-wrapper": "~3.3.0-next.0",
53+
"monaco-editor-wrapper": "~3.3.0-next.2",
5454
"react": "~18.2.0",
5555
"react-dom": "~18.2.0"
5656
},

Diff for: packages/monaco-editor-wrapper/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to npm module [monaco-editor-wrapper](https://www.npmjs.com/
55
## [2.3.0] - 2023-10-xy
66

77
- Properly separate and define classic and extended editor [#54](https://github.com/TypeFox/monaco-components/pull/54)
8-
- Updated to `[email protected].2`
8+
- Updated to `[email protected].3`
99

1010
## [3.2.5] - 2023-10-13
1111

Diff for: packages/monaco-editor-wrapper/package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monaco-editor-wrapper",
3-
"version": "3.3.0-next.0",
3+
"version": "3.3.0-next.2",
44
"license": "MIT",
55
"description": "Monaco-Editor and Monaco Languageclient Wrapper",
66
"keywords": [
@@ -58,12 +58,15 @@
5858
"npm": "9.8.1"
5959
},
6060
"dependencies": {
61-
"@codingame/monaco-vscode-editor-service-override": "~1.82.4",
62-
"@codingame/monaco-vscode-configuration-service-override": "~1.82.4",
63-
"monaco-languageclient": "~6.5.2"
61+
"@codingame/monaco-vscode-configuration-service-override": "~1.82.5",
62+
"@codingame/monaco-vscode-editor-service-override": "~1.82.5",
63+
"@codingame/monaco-vscode-textmate-service-override": "~1.82.5",
64+
"@codingame/monaco-vscode-theme-defaults-default-extension": "~1.82.5",
65+
"@codingame/monaco-vscode-theme-service-override": "~1.82.5",
66+
"monaco-languageclient": "~6.5.3"
6467
},
6568
"peerDependencies": {
66-
"monaco-languageclient": "~6.5.2",
69+
"monaco-languageclient": "~6.5.3",
6770
"vscode-ws-jsonrpc": "~3.0.0"
6871
},
6972
"repository": {

Diff for: packages/monaco-editor-wrapper/test/utils.test.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ describe('createUrl', () => {
77
const url = createUrl({
88
secured: false,
99
host: 'localhost',
10-
port: 3000,
10+
port: 30000,
1111
path: 'sampleServer'
1212
} as WebSocketConfigOptions);
1313

14-
expect(url).toBe('ws://localhost:3000/sampleServer');
14+
expect(url).toBe('ws://localhost:30000/sampleServer');
1515
});
1616

1717
test('test createUrl: wss', () => {
1818
const url = createUrl({
1919
secured: true,
2020
host: 'localhost',
21-
port: 3000,
21+
port: 30000,
2222
path: 'sampleServer'
2323
} as WebSocketConfigOptions);
2424

25-
expect(url).toBe('wss://localhost:3000/sampleServer');
25+
expect(url).toBe('wss://localhost:30000/sampleServer');
2626
});
2727

2828
test('test createUrl: wss, no port, with path', () => {
@@ -39,10 +39,10 @@ describe('createUrl', () => {
3939
const url = createUrl({
4040
secured: true,
4141
host: 'localhost',
42-
port: 3000
42+
port: 30000
4343
} as WebSocketConfigOptions);
4444

45-
expect(url).toBe('wss://localhost:3000');
45+
expect(url).toBe('wss://localhost:30000');
4646
});
4747

4848
test('test createUrl: wss, no port, no path', () => {
@@ -77,26 +77,26 @@ describe('createUrl', () => {
7777

7878
test('test createUrl: optionsUrl: ws', () => {
7979
const url = createUrl({
80-
url: 'ws://localhost:3000/sampleServer'
80+
url: 'ws://localhost:30000/sampleServer'
8181
} as WebSocketConfigOptionsUrl);
8282

83-
expect(url).toBe('ws://localhost:3000/sampleServer');
83+
expect(url).toBe('ws://localhost:30000/sampleServer');
8484
});
8585

8686
test('test createUrl: optionsUrl: wss', () => {
8787
const url = createUrl({
88-
url: 'wss://localhost:3000/sampleServer'
88+
url: 'wss://localhost:30000/sampleServer'
8989
} as WebSocketConfigOptionsUrl);
9090

91-
expect(url).toBe('wss://localhost:3000/sampleServer');
91+
expect(url).toBe('wss://localhost:30000/sampleServer');
9292
});
9393

9494
test('test createUrl: optionsUrl, with port, no path', () => {
9595
const url = createUrl({
96-
url: 'wss://localhost:3000'
96+
url: 'wss://localhost:30000'
9797
} as WebSocketConfigOptionsUrl);
9898

99-
expect(url).toBe('wss://localhost:3000');
99+
expect(url).toBe('wss://localhost:30000');
100100
});
101101

102102
test('test createUrl: optionsUrl, no port, with path', () => {
@@ -117,8 +117,8 @@ describe('createUrl', () => {
117117

118118
test('test createUrl: ws, not proper url', () => {
119119
expect(() => createUrl({
120-
url: 'http://www.testme.com:3000/sampleServer'
121-
} as WebSocketConfigOptionsUrl)).toThrowError('This is not a proper websocket url: http://www.testme.com:3000/sampleServer');
120+
url: 'http://www.testme.com:30000/sampleServer'
121+
} as WebSocketConfigOptionsUrl)).toThrowError('This is not a proper websocket url: http://www.testme.com:30000/sampleServer');
122122
});
123123

124124
});

0 commit comments

Comments
 (0)