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

Commit

Permalink
Update to monaco-languageclient 5.1.0-next.0 and monaco-vscode-api 1.…
Browse files Browse the repository at this point in the history
…78.0
  • Loading branch information
kaisalmen committed Apr 17, 2023
1 parent 01c3b08 commit ba2ef98
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 180 deletions.
83 changes: 55 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"langium-statemachine-dsl": "~1.1.0",
"monaco-editor-wrapper": "2.0.0-next.1",
"@typefox/monaco-editor-react": "1.0.0-next.8",
"monaco-editor-workers": "0.36.0",
"monaco-editor-workers": "0.37.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"request-light": "~0.7.0",
"vscode": "npm:@codingame/monaco-vscode-api@~1.76.6",
"vscode-uri": "~3.0.7",
"vscode-languageclient": "~8.1.0",
"vscode-languageserver": "~8.1.0",
Expand Down
13 changes: 9 additions & 4 deletions packages/examples/src/langium/langiumWrapperConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ export const createLangiumGlobalConfig = async (htmlElement: HTMLElement): Promi
htmlElement: htmlElement,
wrapperConfig: {
useVscodeConfig: true,
monacoVscodeApiConfig: {
activationConfig: {
basePath: '../monaco-editor-wrapper'
serviceConfig: {
enableThemeService: true,
enableLanguagesService: true,
enableConfigurationService: true,
configurationServiceConfig: {
defaultWorkspaceUri: '/tmp/'
},
},
monacoVscodeApiConfig: {
extension: {
name: 'langium-example',
publisher: 'monaco-languageclient-project',
Expand Down Expand Up @@ -60,7 +65,7 @@ export const createLangiumGlobalConfig = async (htmlElement: HTMLElement): Promi
},
extensionFiles: extensionFiles,
userConfiguration: `{
"workbench.colorTheme": "Dark+ (Experimental)",
"workbench.colorTheme": "Default Dark+",
"editor.fontSize": 14,
"editor.lightbulb.enabled": true,
"editor.lineHeight": 20,
Expand Down
8 changes: 4 additions & 4 deletions packages/examples/src/langium/wrapperLangium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const startEditor = async () => {
const langiumGlobalConfig = await createLangiumGlobalConfig(document.getElementById('monaco-editor-root') as HTMLElement);
wrapper
.init(langiumGlobalConfig)
.startEditor()
.then((s: unknown) => {
console.log(s);

.then(() => {
wrapper.startEditor();
})
.then(() => {
vscode.commands.getCommands().then((x) => {
console.log('Currently registered # of vscode commands: ' + x.length);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco-editor-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"npm": "9.6.3"
},
"dependencies": {
"monaco-editor-workers": "0.36.0",
"monaco-editor-wrapper": "2.0.0-next.1",
"monaco-languageclient": "5.1.0-next.0",
"react": "~18.2.0",
"react-dom": "~18.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco-editor-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
},
"dependencies": {
"@types/css-font-loading-module": "~0.0.8",
"monaco-languageclient": "5.0.1",
"monaco-languageclient": "5.1.0-next.0",
"vscode-ws-jsonrpc": "3.0.0",
"normalize-url": "~8.0.0"
},
Expand Down
5 changes: 0 additions & 5 deletions packages/monaco-editor-wrapper/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import {
MonacoEditorWrapper
} from './monacoEditorWrapper.js';

import type {
MonacoVscodeApiActivtion
} from './monacoVscodeApiWrapper.js';

import {
MonacoVscodeApiWrapper
} from './monacoVscodeApiWrapper.js';
Expand All @@ -29,7 +25,6 @@ import {
export type {
EditorConfig,
MonacoLanguageExtensionConfig,
MonacoVscodeApiActivtion,
WebSocketConfigOptions,
WorkerConfigOptions,
UserConfig,
Expand Down
1 change: 0 additions & 1 deletion packages/monaco-editor-wrapper/src/indexAllLanguages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export type {
EditorConfig,
MonacoLanguageExtensionConfig,
MonacoVscodeApiActivtion,
WebSocketConfigOptions,
WorkerConfigOptions,
UserConfig,
Expand Down
11 changes: 8 additions & 3 deletions packages/monaco-editor-wrapper/src/monacoEditorWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ export type MonacoEditorWrapperConfig = {
export class MonacoEditorWrapper {

async init(editorConfig: EditorConfig, runtimeConfig: MonacoEditorWrapperConfig) {
this.updateWrapperConfig(editorConfig, runtimeConfig);

console.log('Init of MonacoConfig was completed.');
return this.updateWrapperConfig(editorConfig, runtimeConfig)
.then(() => {
console.log('Init of MonacoConfig was completed.');
return Promise.resolve();
})
.catch(e => {
return Promise.reject(e);
});
}

async updateWrapperConfig(editorConfig: EditorConfig, runtimeConfig: MonacoEditorWrapperConfig) {
Expand Down

0 comments on commit ba2ef98

Please sign in to comment.