@volar/language-service 1.0.24 → 1.1.0-1.2.0-alpha.1.0
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/baseLanguageService.d.ts +3 -11
- package/out/baseLanguageService.js +33 -23
- package/out/documentFeatures/documentSymbols.js +2 -4
- package/out/documentFeatures/format.js +4 -4
- package/out/languageFeatures/callHierarchy.d.ts +2 -2
- package/out/languageFeatures/callHierarchy.js +14 -17
- package/out/languageFeatures/codeActionResolve.js +3 -5
- package/out/languageFeatures/codeActions.d.ts +2 -2
- package/out/languageFeatures/codeActions.js +12 -4
- package/out/languageFeatures/codeLens.d.ts +4 -4
- package/out/languageFeatures/codeLens.js +16 -10
- package/out/languageFeatures/codeLensResolve.js +10 -4
- package/out/languageFeatures/complete.d.ts +2 -2
- package/out/languageFeatures/complete.js +23 -20
- package/out/languageFeatures/completeResolve.js +3 -5
- package/out/languageFeatures/executeCommand.d.ts +1 -1
- package/out/languageFeatures/executeCommand.js +1 -1
- package/out/languageFeatures/fileRename.js +2 -2
- package/out/languageFeatures/renamePrepare.js +1 -6
- package/out/languageFeatures/validation copy.d.ts +7 -0
- package/out/languageFeatures/validation copy.js +234 -0
- package/out/languageFeatures/validation.d.ts +6 -0
- package/out/languageFeatures/validation.js +116 -39
- package/out/languageFeatures/workspaceSymbols.js +1 -1
- package/out/types.d.ts +37 -6
- package/out/types.js +0 -1
- package/out/utils/common.d.ts +0 -2
- package/out/utils/common.js +1 -28
- package/out/utils/featureWorkers.d.ts +2 -1
- package/out/utils/featureWorkers.js +87 -5
- package/package.json +7 -7
|
@@ -8,13 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.languageFeatureWorker = exports.documentFeatureWorker = void 0;
|
|
11
|
+
exports.ruleWorker = exports.languageFeatureWorker = exports.documentFeatureWorker = void 0;
|
|
12
12
|
const definePlugin_1 = require("./definePlugin");
|
|
13
13
|
function documentFeatureWorker(context, uri, isValidSourceMap, worker, transform, combineResult) {
|
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
return languageFeatureWorker(context, uri,
|
|
15
|
+
return languageFeatureWorker(context, uri, undefined, (_, map, file) => {
|
|
16
16
|
if (isValidSourceMap(file, map)) {
|
|
17
|
-
return [
|
|
17
|
+
return [undefined];
|
|
18
18
|
}
|
|
19
19
|
return [];
|
|
20
20
|
}, worker, transform, combineResult);
|
|
@@ -30,7 +30,7 @@ function languageFeatureWorker(context, uri, arg, transformArg, worker, transfor
|
|
|
30
30
|
if (virtualFile) {
|
|
31
31
|
yield (0, definePlugin_1.visitEmbedded)(context.documents, virtualFile, (file, map) => __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
for (const mappedArg of transformArg(arg, map, file)) {
|
|
33
|
-
for (const plugin of context.plugins) {
|
|
33
|
+
for (const plugin of Object.values(context.plugins)) {
|
|
34
34
|
const embeddedResult = yield worker(plugin, map.virtualFileDocument, mappedArg, map, file);
|
|
35
35
|
if (!embeddedResult)
|
|
36
36
|
continue;
|
|
@@ -50,7 +50,7 @@ function languageFeatureWorker(context, uri, arg, transformArg, worker, transfor
|
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
52
|
else if (document) {
|
|
53
|
-
for (const plugin of context.plugins) {
|
|
53
|
+
for (const plugin of Object.values(context.plugins)) {
|
|
54
54
|
const embeddedResult = yield worker(plugin, document, arg, undefined, undefined);
|
|
55
55
|
if (!embeddedResult)
|
|
56
56
|
continue;
|
|
@@ -75,4 +75,86 @@ function languageFeatureWorker(context, uri, arg, transformArg, worker, transfor
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
exports.languageFeatureWorker = languageFeatureWorker;
|
|
78
|
+
function ruleWorker(context, uri, isValidSourceMap, worker, transform, combineResult, reportProgress) {
|
|
79
|
+
var _a, _b, _c;
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const document = context.getTextDocument(uri);
|
|
82
|
+
const virtualFile = (_a = context.documents.getSourceByUri(uri)) === null || _a === void 0 ? void 0 : _a.root;
|
|
83
|
+
let results = [];
|
|
84
|
+
if (virtualFile) {
|
|
85
|
+
yield (0, definePlugin_1.visitEmbedded)(context.documents, virtualFile, (file, map) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _d, _e;
|
|
87
|
+
if (!isValidSourceMap(file)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
const ruleCtx = {
|
|
91
|
+
ruleId: '',
|
|
92
|
+
document: map.virtualFileDocument,
|
|
93
|
+
report: () => { },
|
|
94
|
+
};
|
|
95
|
+
for (const plugin of Object.values(context.plugins)) {
|
|
96
|
+
(_e = (_d = plugin.validation) === null || _d === void 0 ? void 0 : _d.resolveRuleContext) === null || _e === void 0 ? void 0 : _e.call(_d, ruleCtx);
|
|
97
|
+
}
|
|
98
|
+
for (const ruleName in context.rules) {
|
|
99
|
+
const rule = context.rules[ruleName];
|
|
100
|
+
if (!rule) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
ruleCtx.ruleId = ruleName;
|
|
104
|
+
const embeddedResult = yield worker(ruleName, rule, ruleCtx);
|
|
105
|
+
if (!embeddedResult)
|
|
106
|
+
continue;
|
|
107
|
+
const result = transform(embeddedResult, map);
|
|
108
|
+
if (!result)
|
|
109
|
+
continue;
|
|
110
|
+
results.push(result);
|
|
111
|
+
if (!combineResult)
|
|
112
|
+
return false;
|
|
113
|
+
const isEmptyArray = Array.isArray(result) && result.length === 0;
|
|
114
|
+
if (reportProgress && !isEmptyArray) {
|
|
115
|
+
reportProgress(combineResult(results));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
else if (document) {
|
|
122
|
+
const ruleCtx = {
|
|
123
|
+
ruleId: '',
|
|
124
|
+
document,
|
|
125
|
+
report: () => { },
|
|
126
|
+
};
|
|
127
|
+
for (const plugin of Object.values(context.plugins)) {
|
|
128
|
+
(_c = (_b = plugin.validation) === null || _b === void 0 ? void 0 : _b.resolveRuleContext) === null || _c === void 0 ? void 0 : _c.call(_b, ruleCtx);
|
|
129
|
+
}
|
|
130
|
+
for (const ruleName in context.rules) {
|
|
131
|
+
const rule = context.rules[ruleName];
|
|
132
|
+
if (!rule) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
ruleCtx.ruleId = ruleName;
|
|
136
|
+
const embeddedResult = yield worker(ruleName, rule, ruleCtx);
|
|
137
|
+
if (!embeddedResult)
|
|
138
|
+
continue;
|
|
139
|
+
const result = transform(embeddedResult, undefined);
|
|
140
|
+
if (!result)
|
|
141
|
+
continue;
|
|
142
|
+
results.push(result);
|
|
143
|
+
if (!combineResult)
|
|
144
|
+
break;
|
|
145
|
+
const isEmptyArray = Array.isArray(result) && result.length === 0;
|
|
146
|
+
if (reportProgress && !isEmptyArray) {
|
|
147
|
+
reportProgress(combineResult(results));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (combineResult && results.length > 0) {
|
|
152
|
+
return combineResult(results);
|
|
153
|
+
}
|
|
154
|
+
else if (results.length > 0) {
|
|
155
|
+
return results[0];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
exports.ruleWorker = ruleWorker;
|
|
78
160
|
//# sourceMappingURL=featureWorkers.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-service",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-1.2.0-alpha.1.0",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
],
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/volarjs/volar.js.git",
|
|
13
13
|
"directory": "packages/language-service"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-core": "1.0.
|
|
17
|
-
"@volar/shared": "1.0.
|
|
18
|
-
"@volar/source-map": "1.0.
|
|
19
|
-
"@volar/typescript-faster": "1.0.
|
|
16
|
+
"@volar/language-core": "1.1.0-1.2.0-alpha.1.0",
|
|
17
|
+
"@volar/shared": "1.1.0-1.2.0-alpha.1.0",
|
|
18
|
+
"@volar/source-map": "1.1.0-1.2.0-alpha.1.0",
|
|
19
|
+
"@volar/typescript-faster": "1.1.0-1.2.0-alpha.1.0",
|
|
20
20
|
"vscode-html-languageservice": "^5.0.3",
|
|
21
21
|
"vscode-json-languageservice": "^5.1.3",
|
|
22
22
|
"vscode-languageserver-protocol": "^3.17.2",
|
|
23
23
|
"vscode-languageserver-textdocument": "^1.0.8",
|
|
24
24
|
"vscode-uri": "^3.0.7"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "ffc1267f2766722751551182ce1e717be661247a"
|
|
27
27
|
}
|