@codingame/monaco-vscode-api 1.67.7 → 1.67.8
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 +12 -4
- package/dist/api.amd.js +1 -5
- package/dist/api.cjs +1 -5
- package/dist/api.js +1 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# @codingame/monaco-vscode-api · [](https://www.npmjs.com/package/@codingame/monaco-vscode-api) [](https://www.npmjs.com/package/@codingame/monaco-vscode-api) [](https://github.com/codingame/monaco-vscode-api/pulls)
|
|
2
2
|
|
|
3
|
-
[NPM module](https://www.npmjs.com/) that
|
|
3
|
+
[NPM module](https://www.npmjs.com/) that implements the VSCode api and redirects calls to Monaco editor.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The VSCode api is composed of:
|
|
6
|
+
|
|
7
|
+
- A lot of classes and tools, which are exported the same way as in VSCode.
|
|
8
|
+
- Some features that are supported by Monaco (Language feature registrations...) which are just forwarded to it (with some transformations)
|
|
9
|
+
- Some features that are not supported by Monaco, and in such case:
|
|
10
|
+
- If it's an important feature: we let the user implement it as they wish.
|
|
11
|
+
- If it's some advanced features that don't make a lot of sense on Monaco (debug, tests...), it just throws an error when you try to use it.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
To implement by hands the optional features (type hierarchy, call hierarchy...), you can use the `Services` namespace from `vscode/services`:
|
|
6
15
|
```typescript
|
|
7
16
|
import { Services } from 'vscode/services'
|
|
8
17
|
Services.install({
|
|
@@ -25,7 +34,7 @@ npm install -D @types/vscode
|
|
|
25
34
|
|
|
26
35
|
### Usage
|
|
27
36
|
|
|
28
|
-
Just import it as if you were in a vscode
|
|
37
|
+
Just import it as if you were in a vscode extension:
|
|
29
38
|
|
|
30
39
|
```typescript
|
|
31
40
|
import * as vscode from 'vscode'
|
|
@@ -33,4 +42,3 @@ import * as vscode from 'vscode'
|
|
|
33
42
|
const range = new new vscode.Range(...)
|
|
34
43
|
vscode.languages.registerCompletionItemProvider(...)
|
|
35
44
|
```
|
|
36
|
-
|
package/dist/api.amd.js
CHANGED
|
@@ -7478,11 +7478,7 @@ define(['exports', 'monaco-editor/esm/vs/base/common/errors.js', 'monaco-editor/
|
|
|
7478
7478
|
return data.document;
|
|
7479
7479
|
}
|
|
7480
7480
|
getDocumentData(resource) {
|
|
7481
|
-
|
|
7482
|
-
if (model == null) {
|
|
7483
|
-
throw new Error(`Unable to retrieve document from URI '${resource}'`);
|
|
7484
|
-
}
|
|
7485
|
-
return createDocumentDataFromModel(model);
|
|
7481
|
+
return this.documentsData.get(resource.toString());
|
|
7486
7482
|
}
|
|
7487
7483
|
get onDidAddDocument() { return this._onDidAddDocument.event; }
|
|
7488
7484
|
get onDidRemoveDocument() { return this._onDidRemoveDocument.event; }
|
package/dist/api.cjs
CHANGED
|
@@ -7520,11 +7520,7 @@ class MonacoExtHostDocuments {
|
|
|
7520
7520
|
return data.document;
|
|
7521
7521
|
}
|
|
7522
7522
|
getDocumentData(resource) {
|
|
7523
|
-
|
|
7524
|
-
if (model == null) {
|
|
7525
|
-
throw new Error(`Unable to retrieve document from URI '${resource}'`);
|
|
7526
|
-
}
|
|
7527
|
-
return createDocumentDataFromModel(model);
|
|
7523
|
+
return this.documentsData.get(resource.toString());
|
|
7528
7524
|
}
|
|
7529
7525
|
get onDidAddDocument() { return this._onDidAddDocument.event; }
|
|
7530
7526
|
get onDidRemoveDocument() { return this._onDidRemoveDocument.event; }
|
package/dist/api.js
CHANGED
|
@@ -7493,11 +7493,7 @@ class MonacoExtHostDocuments {
|
|
|
7493
7493
|
return data.document;
|
|
7494
7494
|
}
|
|
7495
7495
|
getDocumentData(resource) {
|
|
7496
|
-
|
|
7497
|
-
if (model == null) {
|
|
7498
|
-
throw new Error(`Unable to retrieve document from URI '${resource}'`);
|
|
7499
|
-
}
|
|
7500
|
-
return createDocumentDataFromModel(model);
|
|
7496
|
+
return this.documentsData.get(resource.toString());
|
|
7501
7497
|
}
|
|
7502
7498
|
get onDidAddDocument() { return this._onDidAddDocument.event; }
|
|
7503
7499
|
get onDidRemoveDocument() { return this._onDidRemoveDocument.event; }
|