@vue/language-service 3.3.5 → 3.3.7
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.
|
@@ -56,7 +56,7 @@ function create(ts, { isRefAtPosition }) {
|
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const charRE = /\w/;
|
|
60
60
|
function isCharacterTyping(document, change) {
|
|
61
61
|
const lastCharacter = change.text[change.text.length - 1];
|
|
62
62
|
const nextCharacter = document.getText().slice(change.rangeOffset + change.text.length, change.rangeOffset + change.text.length + 1);
|
|
@@ -66,7 +66,7 @@ function isCharacterTyping(document, change) {
|
|
|
66
66
|
if (change.text.includes('\n')) { // multi-line change
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return charRE.test(lastCharacter) && !charRE.test(nextCharacter);
|
|
70
70
|
}
|
|
71
71
|
function shouldSkip(ts, node, pos, allowAccessDotValue) {
|
|
72
72
|
if (ts.isVariableDeclaration(node) && pos >= node.name.getFullStart() && pos <= node.name.getEnd()) {
|
|
@@ -7,7 +7,7 @@ const cmds = [
|
|
|
7
7
|
['vue-expect-error'],
|
|
8
8
|
['vue-generic', 'vue-generic {$1}'],
|
|
9
9
|
];
|
|
10
|
-
const
|
|
10
|
+
const directiveCommentRE = /<!--\s*@/;
|
|
11
11
|
/**
|
|
12
12
|
* A language service plugin that provides completion for Vue directive comments,
|
|
13
13
|
* e.g. if user is writing `<!-- |` in they'll be provided completions for `@vue-expect-error`, `@vue-generic`, etc.
|
|
@@ -27,7 +27,7 @@ function create() {
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
const line = document.getText({ start: { line: position.line, character: 0 }, end: position });
|
|
30
|
-
const cmdStart = line.match(
|
|
30
|
+
const cmdStart = line.match(directiveCommentRE);
|
|
31
31
|
if (!cmdStart) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
@@ -6,7 +6,7 @@ exports.createAddComponentToOptionEdit = createAddComponentToOptionEdit;
|
|
|
6
6
|
const language_core_1 = require("@vue/language-core");
|
|
7
7
|
const vscode_uri_1 = require("vscode-uri");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
|
-
const
|
|
9
|
+
const unicodeRE = /\\u/g;
|
|
10
10
|
function create(ts, { collectExtractProps }) {
|
|
11
11
|
return {
|
|
12
12
|
name: 'vue-extract-file',
|
|
@@ -255,7 +255,7 @@ function createAddComponentToOptionEdit(ts, ir, ast, componentName) {
|
|
|
255
255
|
const printText = printer.printNode(ts.EmitHint.Expression, newNode, ast);
|
|
256
256
|
return {
|
|
257
257
|
range: componentOptions.components,
|
|
258
|
-
newText: unescape(printText.replace(
|
|
258
|
+
newText: unescape(printText.replace(unicodeRE, '%u')),
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
else {
|
|
@@ -269,7 +269,7 @@ function createAddComponentToOptionEdit(ts, ir, ast, componentName) {
|
|
|
269
269
|
const printText = printer.printNode(ts.EmitHint.Expression, newNode, ast);
|
|
270
270
|
return {
|
|
271
271
|
range: componentOptions.args,
|
|
272
|
-
newText: unescape(printText.replace(
|
|
272
|
+
newText: unescape(printText.replace(unicodeRE, '%u')),
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
275
|
}
|
|
@@ -598,7 +598,7 @@ function create(ts, languageId, tsserver) {
|
|
|
598
598
|
...props.map(prop => [prop.name, prop]),
|
|
599
599
|
...attrs.map(attr => [attr.name, attr]),
|
|
600
600
|
]) {
|
|
601
|
-
if (
|
|
601
|
+
if (EVENT_PROP_REGEX.test(propName)) {
|
|
602
602
|
let labelName = propName.slice(2);
|
|
603
603
|
labelName = labelName.charAt(0).toLowerCase() + labelName.slice(1);
|
|
604
604
|
if (attrNameCasing === 0 /* AttrNameCasing.Kebab */) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.create = create;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const twoslashTemplateRE = /<!--\s*\^\?\s*-->/g;
|
|
6
|
+
const twoslashScriptRE = /(?<=^|\n)\s*\/\/\s*\^\?/g;
|
|
7
7
|
function create({ getQuickInfoAtPosition }) {
|
|
8
8
|
return {
|
|
9
9
|
name: 'vue-twoslash-queries',
|
|
@@ -19,9 +19,9 @@ function create({ getQuickInfoAtPosition }) {
|
|
|
19
19
|
}
|
|
20
20
|
const hoverOffsets = [];
|
|
21
21
|
const inlayHints = [];
|
|
22
|
-
const
|
|
22
|
+
const twoslashRE = info.code.id === 'template' ? twoslashTemplateRE : twoslashScriptRE;
|
|
23
23
|
const sourceDocument = context.documents.get(info.script.id, info.script.languageId, info.script.snapshot);
|
|
24
|
-
for (const pointer of document.getText(range).matchAll(
|
|
24
|
+
for (const pointer of document.getText(range).matchAll(twoslashRE)) {
|
|
25
25
|
const offset = pointer.index + pointer[0].indexOf('^?') + document.offsetAt(range.start);
|
|
26
26
|
const position = document.positionAt(offset);
|
|
27
27
|
hoverOffsets.push([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-service",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"data",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@volar/language-service": "2.4.28",
|
|
23
|
-
"@vue/language-core": "3.3.
|
|
23
|
+
"@vue/language-core": "3.3.7",
|
|
24
24
|
"@vue/shared": "^3.5.0",
|
|
25
25
|
"path-browserify": "^1.0.1",
|
|
26
26
|
"volar-service-css": "0.0.71",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"vscode-uri": "^3.1.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^
|
|
37
|
+
"@types/node": "^26.0.1",
|
|
38
38
|
"@types/path-browserify": "^1.0.3",
|
|
39
39
|
"@volar/kit": "2.4.28",
|
|
40
40
|
"@volar/typescript": "2.4.28",
|
|
41
41
|
"@vue/compiler-dom": "^3.5.0",
|
|
42
|
-
"@vue/typescript-plugin": "3.3.
|
|
42
|
+
"@vue/typescript-plugin": "3.3.7",
|
|
43
43
|
"vscode-css-languageservice": "^6.3.10",
|
|
44
|
-
"vue-component-meta": "3.3.
|
|
44
|
+
"vue-component-meta": "3.3.7"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "f6cc297eb9b2fddb3bed535b099b9697c909764d"
|
|
47
47
|
}
|