volar-service-json 0.0.0 → 0.0.1
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/out/index.d.ts +5 -1
- package/out/index.js +14 -9
- package/package.json +2 -3
- package/rules.d.ts +0 -10
package/out/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { Service } from '@volar/language-service';
|
|
1
|
+
import type { InjectionKey, Service } from '@volar/language-service';
|
|
2
2
|
import * as json from 'vscode-json-languageservice';
|
|
3
|
+
export declare const rulesInjectionKey: InjectionKey<{
|
|
4
|
+
jsonDocument: json.JSONDocument;
|
|
5
|
+
languageService: json.LanguageService;
|
|
6
|
+
}>;
|
|
3
7
|
declare const _default: (settings?: json.LanguageSettings) => Service;
|
|
4
8
|
export default _default;
|
package/out/index.js
CHANGED
|
@@ -23,7 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.rulesInjectionKey = void 0;
|
|
26
27
|
const json = __importStar(require("vscode-json-languageservice"));
|
|
28
|
+
exports.rulesInjectionKey = Symbol();
|
|
27
29
|
exports.default = (settings) => (context) => {
|
|
28
30
|
// https://github.com/microsoft/vscode/blob/09850876e652688fb142e2e19fd00fd38c0bc4ba/extensions/json-language-features/server/src/jsonServer.ts#L150
|
|
29
31
|
const triggerCharacters = ['"', ':'];
|
|
@@ -36,16 +38,19 @@ exports.default = (settings) => (context) => {
|
|
|
36
38
|
jsonLs.configure(settings);
|
|
37
39
|
}
|
|
38
40
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
rules: {
|
|
42
|
+
provide: {
|
|
43
|
+
[exports.rulesInjectionKey](document) {
|
|
44
|
+
return worker(document, (jsonDocument) => {
|
|
45
|
+
return {
|
|
46
|
+
jsonDocument,
|
|
47
|
+
languageService: jsonLs,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
},
|
|
48
52
|
},
|
|
53
|
+
triggerCharacters,
|
|
49
54
|
provideCompletionItems(document, position) {
|
|
50
55
|
return worker(document, async (jsonDocument) => {
|
|
51
56
|
return await jsonLs.doComplete(document, position, jsonDocument);
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volar-service-json",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
|
-
"rules.d.ts",
|
|
8
7
|
"out/**/*.js",
|
|
9
8
|
"out/**/*.d.ts"
|
|
10
9
|
],
|
|
@@ -26,5 +25,5 @@
|
|
|
26
25
|
"optional": true
|
|
27
26
|
}
|
|
28
27
|
},
|
|
29
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "5bf5152f076f25cb1ddbc7aa6978a8d1c7009fd6"
|
|
30
29
|
}
|