volar-service-json 0.0.0 → 0.0.2
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 +6 -1
- package/out/index.js +10 -9
- package/package.json +2 -3
- package/rules.d.ts +0 -10
package/out/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InjectionKey, Service } from '@volar/language-service';
|
|
2
2
|
import * as json from 'vscode-json-languageservice';
|
|
3
|
+
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
+
export declare const injectionKeys: {
|
|
5
|
+
jsonDocument: InjectionKey<[TextDocument], json.JSONDocument>;
|
|
6
|
+
languageService: InjectionKey<[], json.LanguageService>;
|
|
7
|
+
};
|
|
3
8
|
declare const _default: (settings?: json.LanguageSettings) => Service;
|
|
4
9
|
export default _default;
|
package/out/index.js
CHANGED
|
@@ -23,7 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.injectionKeys = void 0;
|
|
27
|
+
const language_service_1 = require("@volar/language-service");
|
|
26
28
|
const json = __importStar(require("vscode-json-languageservice"));
|
|
29
|
+
exports.injectionKeys = {
|
|
30
|
+
jsonDocument: 'json/jsonDocument',
|
|
31
|
+
languageService: 'json/languageService',
|
|
32
|
+
};
|
|
27
33
|
exports.default = (settings) => (context) => {
|
|
28
34
|
// https://github.com/microsoft/vscode/blob/09850876e652688fb142e2e19fd00fd38c0bc4ba/extensions/json-language-features/server/src/jsonServer.ts#L150
|
|
29
35
|
const triggerCharacters = ['"', ':'];
|
|
@@ -36,16 +42,11 @@ exports.default = (settings) => (context) => {
|
|
|
36
42
|
jsonLs.configure(settings);
|
|
37
43
|
}
|
|
38
44
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
context.json = {
|
|
43
|
-
document: jsonDocument,
|
|
44
|
-
languageService: jsonLs,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
return context;
|
|
45
|
+
provide: {
|
|
46
|
+
...(0, language_service_1.defineProvide)(exports.injectionKeys.jsonDocument, getJsonDocument),
|
|
47
|
+
...(0, language_service_1.defineProvide)(exports.injectionKeys.languageService, () => jsonLs),
|
|
48
48
|
},
|
|
49
|
+
triggerCharacters,
|
|
49
50
|
provideCompletionItems(document, position) {
|
|
50
51
|
return worker(document, async (jsonDocument) => {
|
|
51
52
|
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.2",
|
|
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": "19482084693c7349f461dc75ec52ee6917739c51"
|
|
30
29
|
}
|