@volar/language-server 2.3.0-alpha.7 → 2.3.0-alpha.9
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/lib/server.js +22 -10
- package/package.json +6 -6
package/lib/server.js
CHANGED
|
@@ -184,19 +184,19 @@ function createServerBase(connection, fs) {
|
|
|
184
184
|
activateServerPushDiagnostics(project);
|
|
185
185
|
}
|
|
186
186
|
if (capabilitiesArr.some(data => data.autoInsertionProvider)) {
|
|
187
|
-
const
|
|
188
|
-
const allConfigurationSections = [];
|
|
187
|
+
const triggerCharacterToConfigurationSections = new Map();
|
|
189
188
|
const tryAdd = (char, section) => {
|
|
190
|
-
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
let sectionSet = triggerCharacterToConfigurationSections.get(char);
|
|
190
|
+
if (!sectionSet) {
|
|
191
|
+
triggerCharacterToConfigurationSections.set(char, sectionSet = new Set());
|
|
192
|
+
}
|
|
193
|
+
if (section) {
|
|
194
|
+
sectionSet.add(section);
|
|
194
195
|
}
|
|
195
196
|
};
|
|
196
197
|
for (const data of capabilitiesArr) {
|
|
197
198
|
if (data.autoInsertionProvider) {
|
|
198
199
|
const { triggerCharacters, configurationSections } = data.autoInsertionProvider;
|
|
199
|
-
allTriggerCharacters.push(...triggerCharacters);
|
|
200
200
|
if (configurationSections) {
|
|
201
201
|
if (configurationSections.length !== triggerCharacters.length) {
|
|
202
202
|
throw new Error('configurationSections.length !== triggerCharacters.length');
|
|
@@ -207,15 +207,27 @@ function createServerBase(connection, fs) {
|
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
209
|
for (const char of triggerCharacters) {
|
|
210
|
-
tryAdd(char
|
|
210
|
+
tryAdd(char);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
status.initializeResult.autoInsertion = {
|
|
216
|
-
triggerCharacters:
|
|
217
|
-
configurationSections:
|
|
216
|
+
triggerCharacters: [],
|
|
217
|
+
configurationSections: [],
|
|
218
218
|
};
|
|
219
|
+
for (const [char, sections] of triggerCharacterToConfigurationSections) {
|
|
220
|
+
if (sections.size) {
|
|
221
|
+
for (const section of sections) {
|
|
222
|
+
status.initializeResult.autoInsertion.triggerCharacters.push(char);
|
|
223
|
+
status.initializeResult.autoInsertion.configurationSections.push(section);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
status.initializeResult.autoInsertion.triggerCharacters.push(char);
|
|
228
|
+
status.initializeResult.autoInsertion.configurationSections.push(null);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
219
231
|
}
|
|
220
232
|
return status.initializeResult;
|
|
221
233
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-server",
|
|
3
|
-
"version": "2.3.0-alpha.
|
|
3
|
+
"version": "2.3.0-alpha.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"directory": "packages/language-server"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "2.3.0-alpha.
|
|
16
|
-
"@volar/language-service": "2.3.0-alpha.
|
|
17
|
-
"@volar/snapshot-document": "2.3.0-alpha.
|
|
18
|
-
"@volar/typescript": "2.3.0-alpha.
|
|
15
|
+
"@volar/language-core": "2.3.0-alpha.9",
|
|
16
|
+
"@volar/language-service": "2.3.0-alpha.9",
|
|
17
|
+
"@volar/snapshot-document": "2.3.0-alpha.9",
|
|
18
|
+
"@volar/typescript": "2.3.0-alpha.9",
|
|
19
19
|
"path-browserify": "^1.0.1",
|
|
20
20
|
"request-light": "^0.7.0",
|
|
21
21
|
"vscode-languageserver": "^9.0.1",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/path-browserify": "latest"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "3f741930343896dfc464a893ebe5f3619bb1a1aa"
|
|
30
30
|
}
|