@vue/language-service 3.3.4 → 3.3.6

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 charReg = /\w/;
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 charReg.test(lastCharacter) && !charReg.test(nextCharacter);
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 directiveCommentReg = /<!--\s*@/;
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(directiveCommentReg);
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 unicodeReg = /\\u/g;
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(unicodeReg, '%u')),
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(unicodeReg, '%u')),
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 (propName.match(EVENT_PROP_REGEX)) {
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 twoslashTemplateReg = /<!--\s*\^\?\s*-->/g;
6
- const twoslashScriptReg = /(?<=^|\n)\s*\/\/\s*\^\?/g;
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 twoslashReg = info.code.id === 'template' ? twoslashTemplateReg : twoslashScriptReg;
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(twoslashReg)) {
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.4",
3
+ "version": "3.3.6",
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.4",
23
+ "@vue/language-core": "3.3.6",
24
24
  "@vue/shared": "^3.5.0",
25
25
  "path-browserify": "^1.0.1",
26
26
  "volar-service-css": "0.0.71",
@@ -39,9 +39,9 @@
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.4",
42
+ "@vue/typescript-plugin": "3.3.6",
43
43
  "vscode-css-languageservice": "^6.3.10",
44
- "vue-component-meta": "3.3.4"
44
+ "vue-component-meta": "3.3.6"
45
45
  },
46
- "gitHead": "043a77b6182db32f4076f84a767c1c674ef2b149"
46
+ "gitHead": "4893ec6a4b5ca0d00f8add9aa36c17c47085f05a"
47
47
  }