You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a demo that showcases the service-override features. It allows to register contributions with the same syntaxes as in VSCode.
145
150
It includes:
151
+
146
152
- Languages
147
153
- Language configurations
148
154
- VSCode themes
@@ -157,10 +163,13 @@ It includes:
157
163
It also uses the `getJsonSchemas` function to register them on the monaco json worker and have autocomplete/hover on settings and keybindings.
158
164
159
165
From CLI run:
166
+
160
167
```bash
161
168
cd demo
162
169
npm ci
163
-
npm start
170
+
npm run start
171
+
# OR: for vite debug output
172
+
npm run start:debug
164
173
```
165
174
166
175
### History
@@ -170,17 +179,20 @@ This project was mainly created to make the implementation of [monaco-languagecl
170
179
monaco-languageclient uses [vscode-languageclient](https://www.npmjs.com/package/vscode-languageclient) which was built to run inside a VSCode extension. VSCode extensions communicate with the editor via an [API](https://www.npmjs.com/package/@types/vscode) they can import into their code.
- Some functions to interact with the IDE ([language feature registrations](https://code.visualstudio.com/api/references/vscode-api#languages), [command execution](https://code.visualstudio.com/api/references/vscode-api#commands)...)
174
184
- A lot of utility classes (Range, Position...)
175
185
176
186
The first implementations of [monaco-languageclient](https://github.com/TypeFox/monaco-languageclient) were using a fake VSCode api implementation. The vscode-languageclient was hacked so the VSCode<->protocol object converters were mainly bypassed, so the fake VSCode api was receiving [Language Server Protocol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) objects. Then the objects were transformed using custom transformers into [Monaco](https://www.npmjs.com/package/monaco-editor) objects to communicate with the monaco api.
177
187
178
188
This approach has some disadvantages:
189
+
179
190
- There is a lot of code to transform LSP objects into Monaco objects
180
191
- It's hard to follow the updates of VSCode and the language server protocol
181
192
- It doesn't behave exactly the same as in VSCode
182
193
183
194
With this library, it would be possible to plug vscode-languageclient directly on top of monaco, monaco-languageclient still helps to do so by:
195
+
184
196
- Adding some tweaks to the VSCode LanguageClient (Removing unsupported features...)
185
197
- Providing a default implementations of the required fallback services (`vscode/services`)
186
198
- Providing some examples on how to build an app using it
0 commit comments