@vue/language-service 3.2.8 → 3.3.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/lib/nameCasing.js CHANGED
@@ -83,7 +83,7 @@ function detectTagCasing(code) {
83
83
  function collectTagsWithCache(code) {
84
84
  let cache = collectCache.get(code);
85
85
  if (!cache) {
86
- const ast = code.sfc.template?.ast;
86
+ const ast = code.ir.template?.ast;
87
87
  cache = ast ? collectTags(ast) : new Map();
88
88
  collectCache.set(code, cache);
89
89
  }
@@ -103,7 +103,7 @@ function create({ resolveModuleName }) {
103
103
  if (!info?.code.id.startsWith('style_')) {
104
104
  return false;
105
105
  }
106
- const block = info.root.sfc.styles.find(style => style.name === info.code.id);
106
+ const block = info.root.ir.styles.find(style => style.name === info.code.id);
107
107
  if (!block) {
108
108
  return false;
109
109
  }
@@ -27,8 +27,8 @@ function create(ts, { isRefAtPosition }) {
27
27
  return;
28
28
  }
29
29
  let sourceOffset;
30
- const { sfc } = info.root;
31
- const scriptBlocks = [sfc.script, sfc.scriptSetup].filter(block => !!block);
30
+ const { ir } = info.root;
31
+ const scriptBlocks = [ir.script, ir.scriptSetup].filter(block => !!block);
32
32
  const map = context.language.maps.get(info.code, info.script);
33
33
  if (!scriptBlocks.length) {
34
34
  return;
@@ -18,7 +18,7 @@ function create() {
18
18
  if (info?.code.id !== 'template') {
19
19
  return;
20
20
  }
21
- const { template } = info.root.sfc;
21
+ const { template } = info.root.ir;
22
22
  if (!template) {
23
23
  return;
24
24
  }
@@ -21,7 +21,7 @@ function create({ getComponentNames, getElementNames }) {
21
21
  if (info?.code.id !== 'template') {
22
22
  return;
23
23
  }
24
- const { template } = info.root.sfc;
24
+ const { template } = info.root.ir;
25
25
  if (!template?.ast) {
26
26
  return;
27
27
  }
@@ -34,8 +34,8 @@ function create(ts, { getImportPathForFile }) {
34
34
  if (!importUri || !info.root.vueCompilerOptions.extensions.some(ext => importUri.endsWith(ext))) {
35
35
  return;
36
36
  }
37
- const { sfc } = info.root;
38
- const script = sfc.scriptSetup ?? sfc.script;
37
+ const { ir } = info.root;
38
+ const script = ir.scriptSetup ?? ir.script;
39
39
  if (!script) {
40
40
  return;
41
41
  }
@@ -43,7 +43,7 @@ function create(ts, { getImportPathForFile }) {
43
43
  const baseName = path_browserify_1.posix.basename(importUri);
44
44
  const newName = (0, shared_1.capitalize)((0, shared_1.camelize)(baseName.slice(0, baseName.lastIndexOf('.'))));
45
45
  const additionalEdit = {};
46
- const code = [...(0, language_core_1.forEachEmbeddedCode)(info.root)].find(code => code.id === (sfc.scriptSetup ? 'scriptsetup_raw' : 'script_raw'));
46
+ const code = [...(0, language_core_1.forEachEmbeddedCode)(info.root)].find(code => code.id === (ir.scriptSetup ? 'scriptsetup_raw' : 'script_raw'));
47
47
  const lastImportNode = (0, vue_extract_file_1.getLastImportNode)(ts, script.ast);
48
48
  const incomingFileName = vscode_uri_1.URI.parse(importUri).fsPath.replace(/\\/g, '/');
49
49
  let importPath;
@@ -77,8 +77,8 @@ function create(ts, { getImportPathForFile }) {
77
77
  newText: `\nimport ${newName} from '${importPath}'`
78
78
  + (lastImportNode ? '' : '\n'),
79
79
  });
80
- if (sfc.script) {
81
- const edit = (0, vue_extract_file_1.createAddComponentToOptionEdit)(ts, sfc, sfc.script.ast, newName);
80
+ if (ir.script) {
81
+ const edit = (0, vue_extract_file_1.createAddComponentToOptionEdit)(ts, ir, ir.script.ast, newName);
82
82
  if (edit) {
83
83
  additionalEdit.changes[embeddedDocumentUriStr].push({
84
84
  range: {
@@ -16,7 +16,7 @@ function create({ getDocumentHighlights }) {
16
16
  if (info?.script.id.scheme !== 'file' || info.code.id !== 'main') {
17
17
  return;
18
18
  }
19
- const { template } = info.root.sfc;
19
+ const { template } = info.root.ir;
20
20
  const offset = document.offsetAt(position);
21
21
  if (template?.ast && offset >= template.startTagEnd && offset <= template.endTagStart) {
22
22
  const pos = offset - template.startTagEnd;
@@ -1,9 +1,9 @@
1
1
  import type { LanguageServicePlugin } from '@volar/language-service';
2
- import { type Sfc } from '@vue/language-core';
2
+ import { type IR } from '@vue/language-core';
3
3
  import type * as ts from 'typescript';
4
4
  export declare function create(ts: typeof import('typescript'), { collectExtractProps }: import('@vue/typescript-plugin/lib/requests').Requests): LanguageServicePlugin;
5
5
  export declare function getLastImportNode(ts: typeof import('typescript'), sourceFile: ts.SourceFile): ts.Node | undefined;
6
- export declare function createAddComponentToOptionEdit(ts: typeof import('typescript'), sfc: Sfc, ast: ts.SourceFile, componentName: string): {
6
+ export declare function createAddComponentToOptionEdit(ts: typeof import('typescript'), ir: IR, ast: ts.SourceFile, componentName: string): {
7
7
  range: import("@vue/language-core").TextRange<ts.ObjectLiteralExpression>;
8
8
  newText: string;
9
9
  } | undefined;
@@ -31,12 +31,12 @@ function create(ts, { collectExtractProps }) {
31
31
  if (info?.code.id !== 'template') {
32
32
  return;
33
33
  }
34
- const { sfc } = info.root;
35
- const script = sfc.scriptSetup ?? sfc.script;
36
- if (!sfc.template || !script) {
34
+ const { ir } = info.root;
35
+ const script = ir.scriptSetup ?? ir.script;
36
+ if (!ir.template || !script) {
37
37
  return;
38
38
  }
39
- const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template);
39
+ const templateCodeRange = selectTemplateCode(startOffset, endOffset, ir.template);
40
40
  if (!templateCodeRange) {
41
41
  return;
42
42
  }
@@ -59,12 +59,12 @@ function create(ts, { collectExtractProps }) {
59
59
  if (info?.code.id !== 'template') {
60
60
  return codeAction;
61
61
  }
62
- const { sfc } = info.root;
63
- const script = sfc.scriptSetup ?? sfc.script;
64
- if (!sfc.template || !script) {
62
+ const { ir } = info.root;
63
+ const script = ir.scriptSetup ?? ir.script;
64
+ if (!ir.template || !script) {
65
65
  return codeAction;
66
66
  }
67
- const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template);
67
+ const templateCodeRange = selectTemplateCode(startOffset, endOffset, ir.template);
68
68
  if (!templateCodeRange) {
69
69
  return codeAction;
70
70
  }
@@ -77,11 +77,11 @@ function create(ts, { collectExtractProps }) {
77
77
  const newUri = sfcDocument.uri.slice(0, sfcDocument.uri.lastIndexOf('/') + 1) + `${newName}.vue`;
78
78
  const lastImportNode = getLastImportNode(ts, script.ast);
79
79
  let newFileTags = [];
80
- newFileTags.push(constructTag('template', [], templateInitialIndent, sfc.template.content.slice(templateCodeRange[0], templateCodeRange[1])));
80
+ newFileTags.push(constructTag('template', [], templateInitialIndent, ir.template.content.slice(templateCodeRange[0], templateCodeRange[1])));
81
81
  if (toExtract.length) {
82
82
  newFileTags.push(constructTag('script', ['setup', 'lang="ts"'], scriptInitialIndent, generateNewScriptContents()));
83
83
  }
84
- if (sfc.template.startTagEnd > script.startTagEnd) {
84
+ if (ir.template.startTagEnd > script.startTagEnd) {
85
85
  newFileTags = newFileTags.reverse();
86
86
  }
87
87
  const templateEdits = [
@@ -107,13 +107,13 @@ function create(ts, { collectExtractProps }) {
107
107
  newText: `\nimport ${newName} from './${newName}.vue'`,
108
108
  },
109
109
  ];
110
- if (sfc.script) {
111
- const edit = createAddComponentToOptionEdit(ts, sfc, sfc.script.ast, newName);
110
+ if (ir.script) {
111
+ const edit = createAddComponentToOptionEdit(ts, ir, ir.script.ast, newName);
112
112
  if (edit) {
113
113
  sfcEdits.push({
114
114
  range: {
115
- start: sfcDocument.positionAt(sfc.script.startTagEnd + edit.range.start),
116
- end: sfcDocument.positionAt(sfc.script.startTagEnd + edit.range.end),
115
+ start: sfcDocument.positionAt(ir.script.startTagEnd + edit.range.start),
116
+ end: sfcDocument.positionAt(ir.script.startTagEnd + edit.range.end),
117
117
  },
118
118
  newText: edit.newText,
119
119
  });
@@ -237,8 +237,8 @@ function getLastImportNode(ts, sourceFile) {
237
237
  }
238
238
  return lastImportNode;
239
239
  }
240
- function createAddComponentToOptionEdit(ts, sfc, ast, componentName) {
241
- const componentOptions = language_core_1.tsCodegen.get(sfc)?.getScriptRanges()?.exportDefault?.options;
240
+ function createAddComponentToOptionEdit(ts, ir, ast, componentName) {
241
+ const componentOptions = language_core_1.tsCodegen.get(ir)?.getScriptRanges()?.exportDefault?.options;
242
242
  if (!componentOptions) {
243
243
  return;
244
244
  }
@@ -22,18 +22,18 @@ function create(ts) {
22
22
  return settings[key] ??= await context.env.getConfiguration?.(key) ?? false;
23
23
  }
24
24
  const result = [];
25
- const { sfc } = info.root;
26
- const codegen = language_core_1.tsCodegen.get(sfc);
25
+ const { ir } = info.root;
26
+ const codegen = language_core_1.tsCodegen.get(ir);
27
27
  const inlayHints = [
28
28
  ...codegen?.getGeneratedTemplate()?.inlayHints ?? [],
29
29
  ...codegen?.getGeneratedScript().inlayHints ?? [],
30
30
  ];
31
31
  const scriptSetupRanges = codegen?.getScriptSetupRanges();
32
- if (scriptSetupRanges?.defineProps?.destructured && sfc.scriptSetup?.ast) {
32
+ if (scriptSetupRanges?.defineProps?.destructured && ir.scriptSetup?.ast) {
33
33
  const setting = 'vue.inlayHints.destructuredProps';
34
34
  const enabled = await getSettingEnabled(setting);
35
35
  if (enabled) {
36
- for (const [prop, isShorthand] of findDestructuredProps(ts, sfc.scriptSetup.ast, scriptSetupRanges.defineProps.destructured.keys())) {
36
+ for (const [prop, isShorthand] of findDestructuredProps(ts, ir.scriptSetup.ast, scriptSetupRanges.defineProps.destructured.keys())) {
37
37
  const name = prop.text;
38
38
  const end = prop.getEnd();
39
39
  const pos = isShorthand ? end : end - name.length;
@@ -48,9 +48,9 @@ function create(ts) {
48
48
  }
49
49
  }
50
50
  const blocks = [
51
- sfc.template,
52
- sfc.script,
53
- sfc.scriptSetup,
51
+ ir.template,
52
+ ir.script,
53
+ ir.scriptSetup,
54
54
  ];
55
55
  const start = document.offsetAt(range.start);
56
56
  const end = document.offsetAt(range.end);
@@ -1,2 +1,2 @@
1
1
  import type { LanguageServicePlugin } from '@volar/language-service';
2
- export declare function create({ getComponentNames, getElementNames, getComponentMeta }: import('@vue/typescript-plugin/lib/requests').Requests): LanguageServicePlugin;
2
+ export declare function create({ getComponentNames, getComponentProps, getElementNames }: import('@vue/typescript-plugin/lib/requests').Requests): LanguageServicePlugin;
@@ -38,7 +38,7 @@ const language_core_1 = require("@vue/language-core");
38
38
  const html = __importStar(require("vscode-html-languageservice"));
39
39
  const nameCasing_1 = require("../nameCasing");
40
40
  const utils_1 = require("../utils");
41
- function create({ getComponentNames, getElementNames, getComponentMeta }) {
41
+ function create({ getComponentNames, getComponentProps, getElementNames }) {
42
42
  return {
43
43
  name: 'vue-missing-props-hints',
44
44
  capabilities: {
@@ -63,7 +63,6 @@ function create({ getComponentNames, getElementNames, getComponentMeta }) {
63
63
  const result = [];
64
64
  const attrNameCasing = await (0, nameCasing_1.getAttrNameCasing)(context, info.script.id);
65
65
  const components = await getComponentNames(info.root.fileName) ?? [];
66
- const componentProps = new Map();
67
66
  intrinsicElementNames ??= new Set(await getElementNames(info.root.fileName) ?? []);
68
67
  let token;
69
68
  let current;
@@ -83,15 +82,12 @@ function create({ getComponentNames, getElementNames, getComponentMeta }) {
83
82
  if (tagOffset > document.offsetAt(range.end)) {
84
83
  break;
85
84
  }
86
- if (!componentProps.has(checkTag)) {
87
- if (cancellationToken.isCancellationRequested) {
88
- break;
89
- }
90
- componentProps.set(checkTag, ((await getComponentMeta(info.root.fileName, checkTag))?.props ?? [])
91
- .filter(prop => prop.required));
85
+ if (cancellationToken.isCancellationRequested) {
86
+ break;
92
87
  }
93
88
  current = {
94
- unburnedRequiredProps: [...componentProps.get(checkTag)],
89
+ unburnedRequiredProps: (await getComponentProps(info.root.fileName, tagOffset) ?? [])
90
+ .filter(prop => !prop.optional),
95
91
  labelOffset: scanner.getTokenOffset() + scanner.getTokenLength(),
96
92
  };
97
93
  }
@@ -16,17 +16,17 @@ function create() {
16
16
  if (info?.code.id !== 'template') {
17
17
  return;
18
18
  }
19
- const { sfc } = info.root;
20
- if (!sfc.template) {
19
+ const { ir } = info.root;
20
+ if (!ir.template) {
21
21
  return;
22
22
  }
23
23
  const { resolveStyleClassNames } = info.root.vueCompilerOptions;
24
24
  if (!resolveStyleClassNames) {
25
25
  return;
26
26
  }
27
- const scopedClasses = styleScopedClasses_1.references.get(sfc.template)?.[1] ?? [];
27
+ const scopedClasses = styleScopedClasses_1.references.get(ir.template)?.[1] ?? [];
28
28
  const styleClasses = new Map();
29
- for (const style of sfc.styles) {
29
+ for (const style of ir.styles) {
30
30
  if (!(resolveStyleClassNames === true || style.scoped)) {
31
31
  continue;
32
32
  }
@@ -55,7 +55,7 @@ function create() {
55
55
  }
56
56
  const formatSettings = await context.env.getConfiguration?.('html.format') ?? {};
57
57
  const blockTypes = ['template', 'script', 'style'];
58
- for (const customBlock of info.root.sfc.customBlocks) {
58
+ for (const customBlock of info.root.ir.customBlocks) {
59
59
  blockTypes.push(customBlock.type);
60
60
  }
61
61
  return {
@@ -112,13 +112,13 @@ function create() {
112
112
  if (info?.code.id !== 'root_tags') {
113
113
  return [];
114
114
  }
115
- const { vueSfc, sfc } = info.root;
115
+ const { vueSfc, ir } = info.root;
116
116
  if (!vueSfc) {
117
117
  return;
118
118
  }
119
119
  const originalResult = await htmlServiceInstance.provideDiagnostics?.(document, token);
120
120
  const sfcErrors = [];
121
- const { template } = sfc;
121
+ const { template } = ir;
122
122
  const { startTagEnd = Infinity, endTagStart = -Infinity, } = template ?? {};
123
123
  for (const error of vueSfc.errors) {
124
124
  if ('code' in error) {
@@ -149,50 +149,50 @@ function create() {
149
149
  return;
150
150
  }
151
151
  const result = [];
152
- const { sfc } = info.root;
153
- if (sfc.template) {
152
+ const { ir } = info.root;
153
+ if (ir.template) {
154
154
  result.push({
155
155
  name: 'template',
156
156
  kind: 2,
157
157
  range: {
158
- start: document.positionAt(sfc.template.start),
159
- end: document.positionAt(sfc.template.end),
158
+ start: document.positionAt(ir.template.start),
159
+ end: document.positionAt(ir.template.end),
160
160
  },
161
161
  selectionRange: {
162
- start: document.positionAt(sfc.template.start),
163
- end: document.positionAt(sfc.template.startTagEnd),
162
+ start: document.positionAt(ir.template.start),
163
+ end: document.positionAt(ir.template.startTagEnd),
164
164
  },
165
165
  });
166
166
  }
167
- if (sfc.script) {
167
+ if (ir.script) {
168
168
  result.push({
169
169
  name: 'script',
170
170
  kind: 2,
171
171
  range: {
172
- start: document.positionAt(sfc.script.start),
173
- end: document.positionAt(sfc.script.end),
172
+ start: document.positionAt(ir.script.start),
173
+ end: document.positionAt(ir.script.end),
174
174
  },
175
175
  selectionRange: {
176
- start: document.positionAt(sfc.script.start),
177
- end: document.positionAt(sfc.script.startTagEnd),
176
+ start: document.positionAt(ir.script.start),
177
+ end: document.positionAt(ir.script.startTagEnd),
178
178
  },
179
179
  });
180
180
  }
181
- if (sfc.scriptSetup) {
181
+ if (ir.scriptSetup) {
182
182
  result.push({
183
183
  name: 'script setup',
184
184
  kind: 2,
185
185
  range: {
186
- start: document.positionAt(sfc.scriptSetup.start),
187
- end: document.positionAt(sfc.scriptSetup.end),
186
+ start: document.positionAt(ir.scriptSetup.start),
187
+ end: document.positionAt(ir.scriptSetup.end),
188
188
  },
189
189
  selectionRange: {
190
- start: document.positionAt(sfc.scriptSetup.start),
191
- end: document.positionAt(sfc.scriptSetup.startTagEnd),
190
+ start: document.positionAt(ir.scriptSetup.start),
191
+ end: document.positionAt(ir.scriptSetup.startTagEnd),
192
192
  },
193
193
  });
194
194
  }
195
- for (const style of sfc.styles) {
195
+ for (const style of ir.styles) {
196
196
  let name = 'style';
197
197
  if (style.scoped) {
198
198
  name += ' scoped';
@@ -213,7 +213,7 @@ function create() {
213
213
  },
214
214
  });
215
215
  }
216
- for (const customBlock of sfc.customBlocks) {
216
+ for (const customBlock of ir.customBlocks) {
217
217
  result.push({
218
218
  name: customBlock.type,
219
219
  kind: 2,
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.create = create;
4
4
  const language_core_1 = require("@vue/language-core");
5
- const vscode_uri_1 = require("vscode-uri");
6
5
  const utils_1 = require("../utils");
7
- const documentToSourceFile = new WeakMap();
8
6
  function create(ts) {
9
7
  return {
10
8
  name: 'vue-suggest-define-assignment',
@@ -23,19 +21,27 @@ function create(ts) {
23
21
  if (!enabled) {
24
22
  return;
25
23
  }
26
- const { sfc } = info.root;
27
- const codegen = language_core_1.tsCodegen.get(sfc);
28
- const scriptSetup = sfc.scriptSetup;
24
+ const { ir } = info.root;
25
+ const codegen = language_core_1.tsCodegen.get(ir);
26
+ const scriptSetup = ir.scriptSetup;
29
27
  const scriptSetupRanges = codegen?.getScriptSetupRanges();
30
28
  if (!scriptSetup || !scriptSetupRanges) {
31
29
  return;
32
30
  }
33
- const sourceFile = getSourceFile(ts, document);
34
- if (shouldSkip(ts, sourceFile, document.offsetAt(position))) {
31
+ const map = context.language.maps.get(info.code, info.script);
32
+ let sourceOffset;
33
+ for (const [offset] of map.toSourceLocation(document.offsetAt(position))) {
34
+ sourceOffset = offset;
35
+ break;
36
+ }
37
+ if (sourceOffset === undefined) {
38
+ return;
39
+ }
40
+ const node = ts.getTouchingPropertyName(scriptSetup.ast, sourceOffset - scriptSetup.startTagEnd);
41
+ if (ts.isStringLiteralLike(node)) {
35
42
  return;
36
43
  }
37
44
  const result = [];
38
- const mappings = [...context.language.maps.forEach(info.code)];
39
45
  addDefineCompletionItem(scriptSetupRanges.defineProps?.statement, scriptSetupRanges.withDefaults?.exp ?? scriptSetupRanges.defineProps?.exp, 'props');
40
46
  addDefineCompletionItem(scriptSetupRanges.defineEmits?.statement, scriptSetupRanges.defineEmits?.exp, 'emit');
41
47
  addDefineCompletionItem(scriptSetupRanges.defineSlots?.statement, scriptSetupRanges.defineSlots?.exp, 'slots');
@@ -47,17 +53,15 @@ function create(ts) {
47
53
  if (!exp || exp.start !== statement?.start) {
48
54
  return;
49
55
  }
50
- let offset;
51
- for (const [, map] of mappings) {
52
- for (const [generatedOffset] of map.toGeneratedLocation(scriptSetup.startTagEnd + exp.start)) {
53
- offset = generatedOffset;
54
- break;
55
- }
56
+ let generatedOffset;
57
+ for (const [offset] of map.toGeneratedLocation(scriptSetup.startTagEnd + exp.start)) {
58
+ generatedOffset = offset;
59
+ break;
56
60
  }
57
- if (offset === undefined) {
61
+ if (generatedOffset === undefined) {
58
62
  return;
59
63
  }
60
- const pos = document.positionAt(offset);
64
+ const pos = document.positionAt(generatedOffset);
61
65
  result.push({
62
66
  label: name,
63
67
  kind: 6,
@@ -76,34 +80,4 @@ function create(ts) {
76
80
  },
77
81
  };
78
82
  }
79
- function shouldSkip(ts, node, pos) {
80
- if (ts.isStringLiteral(node) && pos >= node.getFullStart() && pos <= node.getEnd()) {
81
- return true;
82
- }
83
- else if (ts.isTemplateLiteral(node) && pos >= node.getFullStart() && pos <= node.getEnd()) {
84
- return true;
85
- }
86
- else {
87
- let _shouldSkip = false;
88
- node.forEachChild(node => {
89
- if (_shouldSkip) {
90
- return;
91
- }
92
- if (pos >= node.getFullStart() && pos <= node.getEnd()) {
93
- if (shouldSkip(ts, node, pos)) {
94
- _shouldSkip = true;
95
- }
96
- }
97
- });
98
- return _shouldSkip;
99
- }
100
- }
101
- function getSourceFile(ts, document) {
102
- let sourceFile = documentToSourceFile.get(document);
103
- if (!sourceFile) {
104
- sourceFile = ts.createSourceFile(vscode_uri_1.URI.parse(document.uri).path, document.getText(), ts.ScriptTarget.Latest);
105
- documentToSourceFile.set(document, sourceFile);
106
- }
107
- return sourceFile;
108
- }
109
83
  //# sourceMappingURL=vue-suggest-define-assignment.js.map
@@ -16,9 +16,9 @@ function create() {
16
16
  if (info?.code.id !== 'scriptsetup_raw') {
17
17
  return;
18
18
  }
19
- const { sfc } = info.root;
20
- const codegen = language_core_1.tsCodegen.get(sfc);
21
- if (!sfc.scriptSetup) {
19
+ const { ir } = info.root;
20
+ const codegen = language_core_1.tsCodegen.get(ir);
21
+ if (!ir.scriptSetup) {
22
22
  return;
23
23
  }
24
24
  const templateVirtualCode = info.script.generated.embeddedCodes.get('template');
@@ -33,7 +33,7 @@ function create() {
33
33
  if (!arg) {
34
34
  return [];
35
35
  }
36
- const name = sfc.scriptSetup.content.slice(arg.start + 1, arg.end - 1);
36
+ const name = ir.scriptSetup.content.slice(arg.start + 1, arg.end - 1);
37
37
  const range = {
38
38
  start: document.positionAt(arg.start + 1),
39
39
  end: document.positionAt(arg.end - 1),