Skip to content

Update complete uri and model handling in EditorApp #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:

- name: Volta
uses: volta-cli/action@v4
with:
node-version: 20

- name: Use pnpm
uses: pnpm/action-setup@v3
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ Important Project changes and notes about the project's history are found [here]

These are the current versions of packages from this repository and their alignment with **@codingame/monaco-vscode-api** **monaco-editor** and **vscode**:

- **monaco-languageclient**: `9.6.0-next.0` (release date: 2025-04-0x)
- **monaco-editor-wrapper**: `6.7.0-next.0` (release date: 2025-04-0x)
- **@typefox/monaco-editor-react**: `6.7.0-next.0` (release date: 2025-04-0x)
- **monaco-languageclient**: `9.6.0-next.1` (release date: 2025-04-11)
- **monaco-editor-wrapper**: `6.7.0-next.1` (release date: 2025-04-11)
- **@typefox/monaco-editor-react**: `6.7.0-next.1` (release date: 2025-04-11)
- Aligned with:
- **@codingame/monaco-vscode-[editor]-api**: `15.0.3`
- **vscode**: `1.98.2`
- **@codingame/monaco-vscode-[editor]-api**: `16.0.2`
- **vscode**: `1.99.2`
- **monaco-editor**: `0.52.2`
- **vscode-ws-jsonrpc**: `3.4.0` (release date: 2024-12-18)

Expand Down Expand Up @@ -256,12 +256,12 @@ Whenever you used `monaco-editor`/`@codingame/monaco-vscode-editor-api` `vscode`
If you use pnpm or yarn, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency, otherwise the installation will fail:

```json
"vscode": "npm:@codingame/monaco-vscode-extension-api@~15.0.3"
"vscode": "npm:@codingame/monaco-vscode-extension-api@~16.0.2"
```

### @codingame/monaco-vscode-editor-api / monaco-editor usage

When you use the libraries from this project you are no longer are required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~15.0.3"` in you `package.json`. You can directly use it like this:
When you use the libraries from this project you are no longer are required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~16.0.2"` in you `package.json`. You can directly use it like this:

```js
import * as monaco from '@codingame/monaco-vscode-editor-api';
Expand All @@ -271,7 +271,7 @@ If your dependency stack already contains a reference `monaco-editor` you must e

```json
"overrides": {
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~15.0.3"
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~16.0.2"
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/versions-and-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following table describes which version of **monaco-languageclient** and **@

| monaco-languageclient | monaco-editor-wrapper | monaco-editor-react | monaco-vscode-api / editor-api | vscode | monaco-editor | release date | comment |
| :---- | :---- | :--- | :--- | :--- | :--- | :--- | :--- |
| 9.6.0-next.0 | 6.7.0-next.0 | 6.7.0-next.0 | 15.0.3 | 1.98.2 | 0.52.2 | 2025-04-0x | |
| 9.6.0-next.1 | 6.7.0-next.1 | 6.7.0-next.1 | 16.0.2 | 1.99.2 | 0.52.2 | 2025-04-11 | |
| 9.5.0 | 6.6.0 | 6.6.0 | 15.0.2 | 1.97.2 | 0.52.2 | 2025-03-13 | |
| 9.4.0 | 6.4.0 | 6.4.0 | 14.0.4 | 1.97.2 | 0.52.2 | 2025-02-18 | |
| 9.3.0 | 6.3.0 | 6.3.0 | 14.0.2 | 1.97.0 | 0.52.2 | 2025-02-12 | |
Expand Down
2,942 changes: 1,437 additions & 1,505 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
},
"devDependencies": {
"@codingame/esbuild-import-meta-url-plugin": "~1.0.3",
"@codingame/monaco-vscode-rollup-vsix-plugin": "~15.0.3",
"@eslint/eslintrc": "~3.3.0",
"@eslint/js": "~9.23.0",
"@codingame/monaco-vscode-rollup-vsix-plugin": "~16.0.2",
"@eslint/eslintrc": "~3.3.1",
"@eslint/js": "~9.24.0",
"@stylistic/eslint-plugin": "~4.2.0",
"@testing-library/react": "~16.2.0",
"@types/node": "~22.13.17",
"@types/react": "~19.1.0",
"@types/react-dom": "~19.1.0",
"@typescript-eslint/eslint-plugin": "~8.29.0",
"@typescript-eslint/parser": "~8.29.0",
"@testing-library/react": "~16.3.0",
"@types/node": "~22.14.0",
"@types/react": "~19.1.1",
"@types/react-dom": "~19.1.2",
"@typescript-eslint/eslint-plugin": "~8.29.1",
"@typescript-eslint/parser": "~8.29.1",
"@vitejs/plugin-react": "~4.3.4",
"@vitest/browser": "~3.1.1",
"editorconfig": "~2.0.1",
"esbuild": "~0.25.2",
"eslint": "~9.23.0",
"eslint": "~9.24.0",
"eslint-plugin-header": "~3.1.1",
"eslint-plugin-import": "~2.31.0",
"eslint-plugin-unused-imports": "~4.1.4",
Expand All @@ -36,9 +36,9 @@
"minimatch": "~10.0.1",
"playwright": "~1.51.1",
"shx": "~0.4.0",
"typescript": "~5.8.2",
"tsx": "~4.19.3",
"vite": "~6.2.4",
"typescript": "~5.8.3",
"vite": "~6.2.6",
"vitest": "~3.1.1"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

## [9.6.0-next.0] - 2025-04-0x
## [9.6.0-next.1] - 2025-04-1x

- Updated all `@codingame/monaco-vscode` packages to `15.0.3`.
- Updated all `@codingame/monaco-vscode` packages to `16.0.2`.

## [9.5.0] - 2025-03-13

Expand Down
24 changes: 12 additions & 12 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monaco-languageclient",
"version": "9.6.0-next.0",
"version": "9.6.0-next.1",
"description": "Monaco Language client implementation",
"author": {
"name": "TypeFox GmbH",
Expand Down Expand Up @@ -76,17 +76,17 @@
"LICENSE"
],
"dependencies": {
"@codingame/monaco-vscode-api": "~15.0.3",
"@codingame/monaco-vscode-configuration-service-override": "~15.0.3",
"@codingame/monaco-vscode-editor-api": "~15.0.3",
"@codingame/monaco-vscode-editor-service-override": "~15.0.3",
"@codingame/monaco-vscode-extensions-service-override": "~15.0.3",
"@codingame/monaco-vscode-extension-api": "~15.0.3",
"@codingame/monaco-vscode-languages-service-override": "~15.0.3",
"@codingame/monaco-vscode-localization-service-override": "~15.0.3",
"@codingame/monaco-vscode-log-service-override": "~15.0.3",
"@codingame/monaco-vscode-model-service-override": "~15.0.3",
"vscode": "npm:@codingame/monaco-vscode-extension-api@~15.0.3",
"@codingame/monaco-vscode-api": "~16.0.2",
"@codingame/monaco-vscode-configuration-service-override": "~16.0.2",
"@codingame/monaco-vscode-editor-api": "~16.0.2",
"@codingame/monaco-vscode-editor-service-override": "~16.0.2",
"@codingame/monaco-vscode-extensions-service-override": "~16.0.2",
"@codingame/monaco-vscode-extension-api": "~16.0.2",
"@codingame/monaco-vscode-languages-service-override": "~16.0.2",
"@codingame/monaco-vscode-localization-service-override": "~16.0.2",
"@codingame/monaco-vscode-log-service-override": "~16.0.2",
"@codingame/monaco-vscode-model-service-override": "~16.0.2",
"vscode": "npm:@codingame/monaco-vscode-extension-api@~16.0.2",
"vscode-languageclient": "~9.0.1"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/fs/endpoints/emptyEndpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('EmptyFileSystemEndpoint Tests', () => {
test('writeFile', async () => {
const result = await endpoint.writeFile({
resourceUri: '/tmp/test.js',
content: 'console.log("Hello World!");'
content: 'const text = "Hello World!";'
});
expect(result).toEqual({
status: 'denied'
Expand All @@ -31,7 +31,7 @@ describe('EmptyFileSystemEndpoint Tests', () => {
test('syncFile', async () => {
const result = await endpoint.syncFile({
resourceUri: '/tmp/test.js',
content: 'console.log("Hello World!");'
content: 'const text = "Hello World!";'
});
expect(result).toEqual({
status: 'denied'
Expand Down
7 changes: 6 additions & 1 deletion packages/examples/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

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

## [2025.4.1] - 2025-04-0x
## [2025.4.2] - 2025-04-11

- Updated to `[email protected]`, `[email protected]` and `@typefox/[email protected]`.
- Export langium worker via package sub exports.

## [2025.4.1] - 2025-04-02

- Updated to `[email protected]`, `[email protected]` and `@typefox/[email protected]`.

Expand Down
90 changes: 50 additions & 40 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monaco-languageclient-examples",
"version": "2025.4.1",
"version": "2025.4.2",
"description": "Monaco Language client examples",
"author": {
"name": "TypeFox GmbH",
Expand Down Expand Up @@ -35,6 +35,14 @@
"./python-client": {
"types": "./dist/python/client/main.d.ts",
"default": "./dist/python/client/main.js"
},
"./worker/langium": {
"types": "./dist/langium/langium-dsl/worker/langium-server.d.ts",
"default": "./dist/langium/langium-dsl/worker/langium-server.js"
},
"./worker/statemachine": {
"types": "./dist/langium/statemachine/worker/statemachine-server.d.ts",
"default": "./dist/langium/statemachine/worker/statemachine-server.js"
}
},
"typesVersions": {
Expand All @@ -48,8 +56,11 @@
"json-client": [
"dist/json/client/wrapperWs"
],
"python-client": [
"dist/python/client/main"
"worker/langium": [
"dist/langium/langium-dsl/worker/langium-server"
],
"worker/statemachine": [
"dist/langium/statemachine/worker/statemachine-server"
]
}
},
Expand All @@ -71,49 +82,48 @@
"LICENSE"
],
"dependencies": {
"@codingame/monaco-vscode-configuration-service-override": "~15.0.3",
"@codingame/monaco-vscode-cpp-default-extension": "~15.0.3",
"@codingame/monaco-vscode-debug-service-override": "~15.0.3",
"@codingame/monaco-vscode-editor-api": "~15.0.3",
"@codingame/monaco-vscode-environment-service-override": "~15.0.3",
"@codingame/monaco-vscode-explorer-service-override": "~15.0.3",
"@codingame/monaco-vscode-files-service-override": "~15.0.3",
"@codingame/monaco-vscode-groovy-default-extension": "~15.0.3",
"@codingame/monaco-vscode-java-default-extension": "~15.0.3",
"@codingame/monaco-vscode-javascript-default-extension": "~15.0.3",
"@codingame/monaco-vscode-json-default-extension": "~15.0.3",
"@codingame/monaco-vscode-keybindings-service-override": "~15.0.3",
"@codingame/monaco-vscode-lifecycle-service-override": "~15.0.3",
"@codingame/monaco-vscode-localization-service-override": "~15.0.3",
"@codingame/monaco-vscode-preferences-service-override": "~15.0.3",
"@codingame/monaco-vscode-python-default-extension": "~15.0.3",
"@codingame/monaco-vscode-remote-agent-service-override": "~15.0.3",
"@codingame/monaco-vscode-search-result-default-extension": "~15.0.3",
"@codingame/monaco-vscode-search-service-override": "~15.0.3",
"@codingame/monaco-vscode-secret-storage-service-override": "~15.0.3",
"@codingame/monaco-vscode-standalone-json-language-features": "~15.0.3",
"@codingame/monaco-vscode-standalone-languages": "~15.0.3",
"@codingame/monaco-vscode-standalone-typescript-language-features": "~15.0.3",
"@codingame/monaco-vscode-testing-service-override": "~15.0.3",
"@codingame/monaco-vscode-storage-service-override": "~15.0.3",
"@codingame/monaco-vscode-textmate-service-override": "~15.0.3",
"@codingame/monaco-vscode-theme-defaults-default-extension": "~15.0.3",
"@codingame/monaco-vscode-theme-service-override": "~15.0.3",
"@codingame/monaco-vscode-typescript-basics-default-extension": "~15.0.3",
"@codingame/monaco-vscode-typescript-language-features-default-extension": "~15.0.3",
"@codingame/monaco-vscode-views-service-override": "~15.0.3",
"@typefox/monaco-editor-react": "~6.7.0-next.0",
"@codingame/monaco-vscode-configuration-service-override": "~16.0.2",
"@codingame/monaco-vscode-cpp-default-extension": "~16.0.2",
"@codingame/monaco-vscode-debug-service-override": "~16.0.2",
"@codingame/monaco-vscode-editor-api": "~16.0.2",
"@codingame/monaco-vscode-environment-service-override": "~16.0.2",
"@codingame/monaco-vscode-explorer-service-override": "~16.0.2",
"@codingame/monaco-vscode-files-service-override": "~16.0.2",
"@codingame/monaco-vscode-groovy-default-extension": "~16.0.2",
"@codingame/monaco-vscode-java-default-extension": "~16.0.2",
"@codingame/monaco-vscode-javascript-default-extension": "~16.0.2",
"@codingame/monaco-vscode-json-default-extension": "~16.0.2",
"@codingame/monaco-vscode-keybindings-service-override": "~16.0.2",
"@codingame/monaco-vscode-lifecycle-service-override": "~16.0.2",
"@codingame/monaco-vscode-localization-service-override": "~16.0.2",
"@codingame/monaco-vscode-preferences-service-override": "~16.0.2",
"@codingame/monaco-vscode-python-default-extension": "~16.0.2",
"@codingame/monaco-vscode-remote-agent-service-override": "~16.0.2",
"@codingame/monaco-vscode-search-result-default-extension": "~16.0.2",
"@codingame/monaco-vscode-search-service-override": "~16.0.2",
"@codingame/monaco-vscode-secret-storage-service-override": "~16.0.2",
"@codingame/monaco-vscode-standalone-json-language-features": "~16.0.2",
"@codingame/monaco-vscode-standalone-typescript-language-features": "~16.0.2",
"@codingame/monaco-vscode-testing-service-override": "~16.0.2",
"@codingame/monaco-vscode-storage-service-override": "~16.0.2",
"@codingame/monaco-vscode-textmate-service-override": "~16.0.2",
"@codingame/monaco-vscode-theme-defaults-default-extension": "~16.0.2",
"@codingame/monaco-vscode-theme-service-override": "~16.0.2",
"@codingame/monaco-vscode-typescript-basics-default-extension": "~16.0.2",
"@codingame/monaco-vscode-typescript-language-features-default-extension": "~16.0.2",
"@codingame/monaco-vscode-views-service-override": "~16.0.2",
"@typefox/monaco-editor-react": "~6.7.0-next.1",
"cors": "^2.8.5",
"express": "~5.1.0",
"jszip": "~3.10.1",
"langium": "~3.4.0",
"monaco-editor-wrapper": "~6.7.0-next.0",
"monaco-languageclient": "~9.6.0-next.0",
"pyright": "~1.1.398",
"monaco-editor-wrapper": "~6.7.0-next.1",
"monaco-languageclient": "~9.6.0-next.1",
"pyright": "~1.1.399",
"react": "~19.1.0",
"react-dom": "~19.1.0",
"request-light": "~0.8.0",
"vscode": "npm:@codingame/monaco-vscode-extension-api@~15.0.3",
"vscode": "npm:@codingame/monaco-vscode-extension-api@~16.0.2",
"vscode-json-languageservice": "~5.4.4",
"vscode-languageclient": "~9.0.1",
"vscode-languageserver": "~9.0.1",
Expand All @@ -130,7 +140,7 @@
"langium-cli": "~3.4.0",
"mini-coi": "~0.4.2",
"ts-node": "~10.9.1",
"vite-plugin-static-copy": "~2.3.0",
"vite-plugin-static-copy": "~2.3.1",
"vscode-languageserver-types": "~3.17.5"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const setupLangiumClientExtended = async (params: {
'workbench.colorTheme': 'GitHub Dark High Contrast',
'editor.guides.bracketPairsHorizontal': 'active',
'editor.wordBasedSuggestions': 'off',
'editor.experimental.asyncTokenization': true
'editor.experimental.asyncTokenization': true,
'vitest.disableWorkspaceWarning': true
})
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ const context = {
} as unknown as DefaultSharedModuleContext;
const { shared } = createLangiumGrammarServices(context);

console.log('Starting langium-dsl server...');

// Start the language server with the shared services
startLanguageServer(shared);
29 changes: 18 additions & 11 deletions packages/examples/src/langium/statemachine/main-react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ export const runStatemachineReact = async () => {
});
const root = ReactDOM.createRoot(document.getElementById('react-root')!);

const onTextChanged = (textChanges: TextContents) => {
console.log(`text: ${textChanges.modified}\ntextOriginal: ${textChanges.original}`);
};
try {
document.querySelector('#button-start')?.addEventListener('click', async () => {
disableElement('button-start', true);
Expand All @@ -44,23 +41,33 @@ export const runStatemachineReact = async () => {
const App = () => {

const [ height, setHeight ] = useState('80vh');
const [testState, setTestState] = useState<string>('');

const onTextChanged = (textChanges: TextContents) => {
console.log(`text: ${textChanges.modified}\ntextOriginal: ${textChanges.original}`);
setTestState(textChanges.modified as string);
};

useEffect(() => {
const timer = setTimeout(() => {
console.log('Updating styles');
setHeight('85vh');
}, 2000);
setHeight('50vh');
}, 1000);

return () => clearTimeout(timer);
}, []);

return (
<div style={{ 'height': height }} >
<MonacoEditorReactComp
style={{ 'height': '100%' }}
wrapperConfig={wrapperConfig}
onTextChanged={onTextChanged} />
</div>
<>
<div style={{ 'height': height }} >
<MonacoEditorReactComp
style={{ 'height': '100%' }}
wrapperConfig={wrapperConfig}
onTextChanged={onTextChanged}
/>
<b>Debug:</b><br />{testState}
</div>
</>
);
};
const strictMode = (document.getElementById('checkbox-strictmode')! as HTMLInputElement).checked;
Expand Down
Loading