diff --git a/package.json b/package.json
index 12b5376536..2e95edd2db 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,7 @@
"release:next-base": "npm run release:base -- --dist-tag next",
"release:next-vue": "cd ./extensions/vscode && npm run release:next",
"test": "vitest run",
+ "test:update": "vitest run --update",
"lint": "tsslint --projects {tsconfig.json,packages/*/tsconfig.json,extensions/*/tsconfig.json}",
"lint:fix": "npm run lint -- --fix",
"chrome": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=./extensions/vscode ../volar-starter"
@@ -31,6 +32,15 @@
},
"pnpm": {
"overrides": {
+ "@volar/kit": "https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee",
+ "@volar/language-core": "https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee",
+ "@volar/language-server": "https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee",
+ "@volar/language-service": "https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee",
+ "@volar/source-map": "https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee",
+ "@volar/test-utils": "https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee",
+ "@volar/typescript": "https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee",
+ "@volar/vscode": "https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee",
+ "volar-service-typescript": "https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed",
"inquirer": "9.2.23"
}
}
diff --git a/packages/language-server/lib/initialize.ts b/packages/language-server/lib/initialize.ts
index 0ef344ed69..450353bfcb 100644
--- a/packages/language-server/lib/initialize.ts
+++ b/packages/language-server/lib/initialize.ts
@@ -56,7 +56,7 @@ export function initialize(
};
}
),
- getFullLanguageServicePlugins(ts)
+ getFullLanguageServicePlugins(ts, { disableAutoImportCache: params.initializationOptions.typescript.disableAutoImportCache })
);
function updateFileWatcher(vueCompilerOptions: VueCompilerOptions) {
diff --git a/packages/language-server/package.json b/packages/language-server/package.json
index bd4773003b..543f4ee864 100644
--- a/packages/language-server/package.json
+++ b/packages/language-server/package.json
@@ -17,6 +17,7 @@
"dependencies": {
"@volar/language-core": "~2.4.0",
"@volar/language-server": "~2.4.0",
+ "@volar/test-utils": "~2.4.0",
"@vue/language-core": "2.0.28",
"@vue/language-service": "2.0.28",
"@vue/typescript-plugin": "2.0.28",
diff --git a/packages/language-server/tests/completions.spec.ts b/packages/language-server/tests/completions.spec.ts
new file mode 100644
index 0000000000..9323cef6f0
--- /dev/null
+++ b/packages/language-server/tests/completions.spec.ts
@@ -0,0 +1,410 @@
+import { TextDocument } from '@volar/language-server';
+import { afterEach, describe, expect, it } from 'vitest';
+import { URI } from 'vscode-uri';
+import { getLanguageServer, testWorkspacePath } from './server.js';
+
+describe('Completions', async () => {
+
+ it('Vue tags', async () => {
+ expect(
+ (await requestCompletionList('fixture.vue', 'vue', `<|`)).items.map(item => item.label)
+ ).toMatchInlineSnapshot(`
+ [
+ "template",
+ "script",
+ "script setup",
+ "style",
+ "script lang="ts"",
+ "script lang="tsx"",
+ "script lang="jsx"",
+ "script setup lang="ts"",
+ "script setup lang="tsx"",
+ "script setup lang="jsx"",
+ "style lang="css"",
+ "style lang="scss"",
+ "style lang="less"",
+ "style lang="postcss"",
+ "template lang="pug"",
+ ]
+ `);
+ });
+
+ it('HTML tags and built-in components', async () => {
+ expect(
+ (await requestCompletionList('fixture.vue', 'vue', `<| />`)).items.map(item => item.label)
+ ).toMatchInlineSnapshot(`
+ [
+ "!DOCTYPE",
+ "html",
+ "head",
+ "title",
+ "base",
+ "link",
+ "meta",
+ "style",
+ "body",
+ "article",
+ "section",
+ "nav",
+ "aside",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "header",
+ "footer",
+ "address",
+ "p",
+ "hr",
+ "pre",
+ "blockquote",
+ "ol",
+ "ul",
+ "li",
+ "dl",
+ "dt",
+ "dd",
+ "figure",
+ "figcaption",
+ "main",
+ "div",
+ "a",
+ "em",
+ "strong",
+ "small",
+ "s",
+ "cite",
+ "q",
+ "dfn",
+ "abbr",
+ "ruby",
+ "rb",
+ "rt",
+ "rp",
+ "time",
+ "code",
+ "var",
+ "samp",
+ "kbd",
+ "sub",
+ "sup",
+ "i",
+ "b",
+ "u",
+ "mark",
+ "bdi",
+ "bdo",
+ "span",
+ "br",
+ "wbr",
+ "ins",
+ "del",
+ "picture",
+ "img",
+ "iframe",
+ "embed",
+ "object",
+ "param",
+ "video",
+ "audio",
+ "source",
+ "track",
+ "map",
+ "area",
+ "table",
+ "caption",
+ "colgroup",
+ "col",
+ "tbody",
+ "thead",
+ "tfoot",
+ "tr",
+ "td",
+ "th",
+ "form",
+ "label",
+ "input",
+ "button",
+ "select",
+ "datalist",
+ "optgroup",
+ "option",
+ "textarea",
+ "output",
+ "progress",
+ "meter",
+ "fieldset",
+ "legend",
+ "details",
+ "summary",
+ "dialog",
+ "script",
+ "noscript",
+ "canvas",
+ "data",
+ "hgroup",
+ "menu",
+ "Transition",
+ "TransitionGroup",
+ "KeepAlive",
+ "Teleport",
+ "Suspense",
+ "component",
+ "slot",
+ "template",
+ "fixture",
+ ]
+ `);
+ });
+
+ it('Directives', async () => {
+ await requestCompletionItem('fixture.vue', 'vue', ``, 'v-html');
+ await requestCompletionItem('fixture.vue', 'vue', ``, 'v-cloak');
+ await requestCompletionItem('fixture.vue', 'vue', ``, 'v-else');
+ await requestCompletionItem('fixture.vue', 'vue', ``, 'v-pre');
+ });
+
+ it('$event argument', async () => {
+ await requestCompletionItem('fixture.vue', 'vue', ``, 'event');
+ });
+
+ it('
+ `, 'foo');
+ });
+
+ it('Slot name', async () => {
+ await requestCompletionItem('fixture.vue', 'vue', `
+
+
+
+
+
+
+
+ `, 'default');
+ });
+
+ it('#2454', async () => {
+ await requestCompletionItem('fixture.vue', 'vue', `
+
+
+
+
+
+ `, 'v-loading');
+ });
+
+ it('#2511', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/component-for-auto-import.vue', 'vue', ``);
+ expect(
+ (await requestCompletionItem('tsconfigProject/fixture.vue', 'vue', `
+
+ `, 'ComponentForAutoImport')).textEdit
+ ).toMatchInlineSnapshot(`
+ {
+ "newText": "import componentForAutoImport$1 from './component-for-auto-import.vue';",
+ "range": {
+ "end": {
+ "character": 23,
+ "line": 2,
+ },
+ "start": {
+ "character": 4,
+ "line": 2,
+ },
+ },
+ }
+ `);
+ });
+
+ it('#3658', async () => {
+ await requestCompletionItem('fixture.vue', 'vue', `
+
+
+
+ {{ fo| }}
+
+
+
+ `, 'foo');
+ });
+
+ it('#4639', async () => {
+ await requestCompletionItem('fixture.vue', 'vue', `
+
+
+
+ `, 'capture');
+ });
+
+ it('Alias path', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await requestCompletionItem('tsconfigProject/fixture.vue', 'vue', `
+
+ `, 'empty.vue');
+ });
+
+ it('Relative path', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await requestCompletionItem('tsconfigProject/fixture.vue', 'vue', `
+
+ `, 'empty.vue');
+ });
+
+ it('Component auto import', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/ComponentForAutoImport.vue', 'vue', ``);
+ expect(
+ (await requestCompletionItem('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+ `, 'ComponentForAutoImport'))
+ ).toMatchInlineSnapshot(`
+ {
+ "additionalTextEdits": [
+ {
+ "newText": "
+ import ComponentForAutoImport from './ComponentForAutoImport.vue';
+ ",
+ "range": {
+ "end": {
+ "character": 28,
+ "line": 1,
+ },
+ "start": {
+ "character": 28,
+ "line": 1,
+ },
+ },
+ },
+ ],
+ "detail": "Add import from "./ComponentForAutoImport.vue"
+ (property) default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly>, {}, {}>",
+ "documentation": {
+ "kind": "markdown",
+ "value": "",
+ },
+ "insertTextFormat": 1,
+ "kind": 5,
+ "label": "ComponentForAutoImport",
+ "labelDetails": {
+ "description": "./ComponentForAutoImport.vue",
+ },
+ "sortText": "16",
+ "textEdit": {
+ "newText": "ComponentForAutoImport",
+ "range": {
+ "end": {
+ "character": 19,
+ "line": 5,
+ },
+ "start": {
+ "character": 6,
+ "line": 5,
+ },
+ },
+ },
+ }
+ `);
+ });
+
+ it('core#8811', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await requestCompletionItem('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+ `, ':-foo-bar');
+ });
+
+ const openedDocuments: TextDocument[] = [];
+
+ afterEach(async () => {
+ const server = await getLanguageServer();
+ for (const document of openedDocuments) {
+ await server.closeTextDocument(document.uri);
+ }
+ openedDocuments.length = 0;
+ });
+
+ /**
+ * @deprecated Remove this when #4717 fixed.
+ */
+ async function ensureGlobalTypesHolder(folderName: string) {
+ const document = await prepareDocument(`${folderName}/globalTypesHolder.vue`, 'vue', '');
+ const server = await getLanguageServer();
+ await server.sendDocumentDiagnosticRequest(document.uri);
+ }
+
+ async function requestCompletionItem(fileName: string, languageId: string, content: string, itemLabel: string) {
+ const completions = await requestCompletionList(fileName, languageId, content);
+ let completion = completions.items.find(item => item.label === itemLabel);
+ expect(completion).toBeDefined();
+ if (completion!.data) {
+ const server = await getLanguageServer();
+ completion = await server.sendCompletionResolveRequest(completion!);
+ expect(completion).toBeDefined();
+ }
+ return completion!;
+ }
+
+ async function requestCompletionList(fileName: string, languageId: string, content: string) {
+ const offset = content.indexOf('|');
+ expect(offset).toBeGreaterThanOrEqual(0);
+ content = content.slice(0, offset) + content.slice(offset + 1);
+
+ const server = await getLanguageServer();
+ let document = await prepareDocument(fileName, languageId, content);
+
+ const position = document.positionAt(offset);
+ const completions = await server.sendCompletionRequest(document.uri, position);
+ expect(completions).toBeDefined();
+
+ return completions!;
+ }
+
+ async function prepareDocument(fileName: string, languageId: string, content: string) {
+ const server = await getLanguageServer();
+ const uri = URI.file(`${testWorkspacePath}/${fileName}`);
+ const document = await server.openInMemoryDocument(uri.toString(), languageId, content);
+ if (openedDocuments.every(d => d.uri !== document.uri)) {
+ openedDocuments.push(document);
+ }
+ return document;
+ }
+});
diff --git a/packages/language-server/tests/definitions.spec.ts b/packages/language-server/tests/definitions.spec.ts
new file mode 100644
index 0000000000..c4458568bf
--- /dev/null
+++ b/packages/language-server/tests/definitions.spec.ts
@@ -0,0 +1,161 @@
+import { Location, TextDocument } from '@volar/language-server';
+import { afterEach, describe, expect, it } from 'vitest';
+import { URI } from 'vscode-uri';
+import { getLanguageServer, testWorkspacePath } from './server.js';
+
+describe('Definitions', async () => {
+
+ it('TS to vue', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestDefinition('tsconfigProject/fixture1.ts', 'typescript', `import C|omponent from './empty.vue';`)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 0,
+ "line": 0,
+ },
+ "start": {
+ "character": 0,
+ "line": 0,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/empty.vue",
+ },
+ ]
+ `);
+ expect(
+ await requestDefinition('tsconfigProject/fixture2.ts', 'typescript', `import Component from '|./empty.vue';`)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 0,
+ "line": 0,
+ },
+ "start": {
+ "character": 0,
+ "line": 0,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/empty.vue",
+ },
+ ]
+ `);
+ });
+
+ it('Alias path', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/foo.ts', 'typescript', `export const foo = 'foo';`);
+ expect(
+ await requestDefinition('tsconfigProject/fixture.vue', 'vue', `
+
+ `)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 25,
+ "line": 0,
+ },
+ "start": {
+ "character": 0,
+ "line": 0,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/foo.ts",
+ },
+ ]
+ `);
+ });
+
+ it('#2600', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/foo.vue', 'vue', `
+
+ {{ msg }}
+
+
+
+ `);
+ expect(
+ await requestDefinition('tsconfigProject/fixture.vue', 'vue', `
+
+ `)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 0,
+ "line": 0,
+ },
+ "start": {
+ "character": 0,
+ "line": 0,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/foo.vue",
+ },
+ ]
+ `);
+ });
+
+ const openedDocuments: TextDocument[] = [];
+
+ afterEach(async () => {
+ const server = await getLanguageServer();
+ for (const document of openedDocuments) {
+ await server.closeTextDocument(document.uri);
+ }
+ openedDocuments.length = 0;
+ });
+
+ /**
+ * @deprecated Remove this when #4717 fixed.
+ */
+ async function ensureGlobalTypesHolder(folderName: string) {
+ const document = await prepareDocument(`${folderName}/globalTypesHolder.vue`, 'vue', '');
+ const server = await getLanguageServer();
+ await server.sendDocumentDiagnosticRequest(document.uri);
+ }
+
+ async function requestDefinition(fileName: string, languageId: string, content: string) {
+ const offset = content.indexOf('|');
+ expect(offset).toBeGreaterThanOrEqual(0);
+ content = content.slice(0, offset) + content.slice(offset + 1);
+
+ const server = await getLanguageServer();
+ let document = await prepareDocument(fileName, languageId, content);
+
+ const position = document.positionAt(offset);
+ const definition = await server.sendDefinitionRequest(document.uri, position) as Location[] | null;
+ expect(definition).toBeDefined();
+
+ for (const loc of definition!) {
+ loc.uri = loc.uri.replace(URI.file(testWorkspacePath).toString(), 'file://${testWorkspacePath}');
+ }
+
+ return definition!;
+ }
+
+ async function prepareDocument(fileName: string, languageId: string, content: string) {
+ const server = await getLanguageServer();
+ const uri = URI.file(`${testWorkspacePath}/${fileName}`);
+ const document = await server.openInMemoryDocument(uri.toString(), languageId, content);
+ if (openedDocuments.every(d => d.uri !== document.uri)) {
+ openedDocuments.push(document);
+ }
+ return document;
+ }
+});
diff --git a/packages/language-server/tests/inlayHints.spec.ts b/packages/language-server/tests/inlayHints.spec.ts
new file mode 100644
index 0000000000..f3ac6a899a
--- /dev/null
+++ b/packages/language-server/tests/inlayHints.spec.ts
@@ -0,0 +1,222 @@
+import { TextDocument } from '@volar/language-server';
+import { afterEach, describe, expect, it } from 'vitest';
+import { URI } from 'vscode-uri';
+import { getLanguageServer, testWorkspacePath } from './server.js';
+
+describe('Definitions', async () => {
+
+ it('Inline handler leading', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestInlayHintsResult('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+ `)
+ ).toMatchInlineSnapshot(`
+ "
+
+
+
+ */a = 1">
+
+ "
+ `);
+ });
+
+ it('Missing props', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ prepareDocument('tsconfigProject/foo.vue', 'vue', `
+
+ `);
+ expect(
+ await requestInlayHintsResult('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+ `)
+ ).toMatchInlineSnapshot(`
+ "
+
+
+
+
+
+ "
+ `);
+ });
+
+ it('Options wrapper', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestInlayHintsResult('tsconfigProject/fixture.vue', 'vue', `
+
+ `)
+ ).toMatchInlineSnapshot(`
+ "
+
+ "
+ `);
+ });
+
+ it('Destructured props', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestInlayHintsResult('tsconfigProject/fixture.vue', 'vue', `
+
+ `)
+ ).toMatchInlineSnapshot(`
+ "
+
+ "
+ `);
+ });
+
+ const openedDocuments: TextDocument[] = [];
+
+ afterEach(async () => {
+ const server = await getLanguageServer();
+ for (const document of openedDocuments) {
+ await server.closeTextDocument(document.uri);
+ }
+ openedDocuments.length = 0;
+ });
+
+ /**
+ * @deprecated Remove this when #4717 fixed.
+ */
+ async function ensureGlobalTypesHolder(folderName: string) {
+ const document = await prepareDocument(`${folderName}/globalTypesHolder.vue`, 'vue', '');
+ const server = await getLanguageServer();
+ await server.sendDocumentDiagnosticRequest(document.uri);
+ }
+
+ async function requestInlayHintsResult(fileName: string, languageId: string, content: string) {
+ const server = await getLanguageServer();
+ let document = await prepareDocument(fileName, languageId, content);
+
+ const inlayHints = await server.sendInlayHintRequest(document.uri, { start: document.positionAt(0), end: document.positionAt(content.length) });
+ expect(inlayHints).toBeDefined();
+ expect(inlayHints!.length).greaterThan(0);
+
+ let text = document.getText();
+ for (const hint of inlayHints!.sort((a, b) => document.offsetAt(b.position) - document.offsetAt(a.position))) {
+ const offset = document.offsetAt(hint.position);
+ text = text.slice(0, offset) + '/* ' + hint.label + ' */' + text.slice(offset);
+ }
+
+ return text;
+ }
+
+ async function prepareDocument(fileName: string, languageId: string, content: string) {
+ const server = await getLanguageServer();
+ const uri = URI.file(`${testWorkspacePath}/${fileName}`);
+ const document = await server.openInMemoryDocument(uri.toString(), languageId, content);
+ if (openedDocuments.every(d => d.uri !== document.uri)) {
+ openedDocuments.push(document);
+ }
+ return document;
+ }
+});
diff --git a/packages/language-server/tests/references.spec.ts b/packages/language-server/tests/references.spec.ts
new file mode 100644
index 0000000000..3de11c2764
--- /dev/null
+++ b/packages/language-server/tests/references.spec.ts
@@ -0,0 +1,199 @@
+import { TextDocument } from '@volar/language-server';
+import { afterEach, describe, expect, it } from 'vitest';
+import { URI } from 'vscode-uri';
+import { getLanguageServer, testWorkspacePath } from './server.js';
+
+describe('Definitions', async () => {
+
+ it('Default slot', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/foo.vue', 'vue', `
+
+
+
+
+
+
+
+ `);
+ expect(
+ await requestReferences('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+ `)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 16,
+ "line": 7,
+ },
+ "start": {
+ "character": 5,
+ "line": 7,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/foo.vue",
+ },
+ {
+ "range": {
+ "end": {
+ "character": 10,
+ "line": 2,
+ },
+ "start": {
+ "character": 6,
+ "line": 2,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/fixture.vue",
+ },
+ ]
+ `);
+ });
+
+ it('Named slot', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/foo.vue', 'vue', `
+
+
+
+
+
+ `);
+ expect(
+ await requestReferences('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+ `)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 17,
+ "line": 6,
+ },
+ "start": {
+ "character": 14,
+ "line": 6,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/foo.vue",
+ },
+ {
+ "range": {
+ "end": {
+ "character": 19,
+ "line": 2,
+ },
+ "start": {
+ "character": 16,
+ "line": 2,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/fixture.vue",
+ },
+ ]
+ `);
+ });
+
+ it('v-bind shorthand', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestReferences('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+ `)
+ ).toMatchInlineSnapshot(`
+ [
+ {
+ "range": {
+ "end": {
+ "character": 14,
+ "line": 6,
+ },
+ "start": {
+ "character": 11,
+ "line": 6,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/fixture.vue",
+ },
+ {
+ "range": {
+ "end": {
+ "character": 13,
+ "line": 2,
+ },
+ "start": {
+ "character": 10,
+ "line": 2,
+ },
+ },
+ "uri": "file://\${testWorkspacePath}/tsconfigProject/fixture.vue",
+ },
+ ]
+ `);
+ });
+
+ const openedDocuments: TextDocument[] = [];
+
+ afterEach(async () => {
+ const server = await getLanguageServer();
+ for (const document of openedDocuments) {
+ await server.closeTextDocument(document.uri);
+ }
+ openedDocuments.length = 0;
+ });
+
+ /**
+ * @deprecated Remove this when #4717 fixed.
+ */
+ async function ensureGlobalTypesHolder(folderName: string) {
+ const document = await prepareDocument(`${folderName}/globalTypesHolder.vue`, 'vue', '');
+ const server = await getLanguageServer();
+ await server.sendDocumentDiagnosticRequest(document.uri);
+ }
+
+ async function requestReferences(fileName: string, languageId: string, content: string) {
+ const offset = content.indexOf('|');
+ expect(offset).toBeGreaterThanOrEqual(0);
+ content = content.slice(0, offset) + content.slice(offset + 1);
+
+ const server = await getLanguageServer();
+ let document = await prepareDocument(fileName, languageId, content);
+
+ const position = document.positionAt(offset);
+ const references = await server.sendReferencesRequest(document.uri, position, { includeDeclaration: false });
+ expect(references).toBeDefined();
+
+ for (const loc of references!) {
+ loc.uri = loc.uri.replace(URI.file(testWorkspacePath).toString(), 'file://${testWorkspacePath}');
+ }
+
+ return references!;
+ }
+
+ async function prepareDocument(fileName: string, languageId: string, content: string) {
+ const server = await getLanguageServer();
+ const uri = URI.file(`${testWorkspacePath}/${fileName}`);
+ const document = await server.openInMemoryDocument(uri.toString(), languageId, content);
+ if (openedDocuments.every(d => d.uri !== document.uri)) {
+ openedDocuments.push(document);
+ }
+ return document;
+ }
+});
diff --git a/packages/language-server/tests/renaming.spec.ts b/packages/language-server/tests/renaming.spec.ts
new file mode 100644
index 0000000000..1e2150c5c4
--- /dev/null
+++ b/packages/language-server/tests/renaming.spec.ts
@@ -0,0 +1,798 @@
+import { TextDocument } from '@volar/language-server';
+import { afterEach, describe, expect, it } from 'vitest';
+import { URI } from 'vscode-uri';
+import { getLanguageServer, testWorkspacePath } from './server.js';
+
+describe('Renaming', async () => {
+
+ it('#2410', async () => {
+ expect(
+ await requestRename('fixture.vue', 'vue', `<|h1>`, 'h2')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/fixture.vue": [
+ {
+ "newText": "h2",
+ "range": {
+ "end": {
+ "character": 18,
+ "line": 0,
+ },
+ "start": {
+ "character": 16,
+ "line": 0,
+ },
+ },
+ },
+ {
+ "newText": "h2",
+ "range": {
+ "end": {
+ "character": 13,
+ "line": 0,
+ },
+ "start": {
+ "character": 11,
+ "line": 0,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ expect(
+ await requestRename('fixture.vue', 'vue', ``, 'h2')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/fixture.vue": [
+ {
+ "newText": "h2",
+ "range": {
+ "end": {
+ "character": 18,
+ "line": 0,
+ },
+ "start": {
+ "character": 16,
+ "line": 0,
+ },
+ },
+ },
+ {
+ "newText": "h2",
+ "range": {
+ "end": {
+ "character": 13,
+ "line": 0,
+ },
+ "start": {
+ "character": 11,
+ "line": 0,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('CSS', async () => {
+ expect(
+ await requestRename('fixture.vue', 'vue', `
+
+
+
+
+
+
+
+ `, 'bar')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/fixture.vue": [
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 28,
+ "line": 2,
+ },
+ "start": {
+ "character": 25,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 8,
+ "line": 7,
+ },
+ "start": {
+ "character": 5,
+ "line": 7,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ expect(
+ await requestRename('fixture.vue', 'vue', `
+
+
+
+
+
+ `, 'bar')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/fixture.vue": [
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 20,
+ "line": 2,
+ },
+ "start": {
+ "character": 17,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 8,
+ "line": 6,
+ },
+ "start": {
+ "character": 5,
+ "line": 6,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ expect(
+ await requestRename('fixture.vue', 'vue', `
+
+
+
+
+
+ `, 'bar')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/fixture.vue": [
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 34,
+ "line": 10,
+ },
+ "start": {
+ "character": 31,
+ "line": 10,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 28,
+ "line": 10,
+ },
+ "start": {
+ "character": 25,
+ "line": 10,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 28,
+ "line": 7,
+ },
+ "start": {
+ "character": 25,
+ "line": 7,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 13,
+ "line": 2,
+ },
+ "start": {
+ "character": 10,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 35,
+ "line": 12,
+ },
+ "start": {
+ "character": 32,
+ "line": 12,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 29,
+ "line": 12,
+ },
+ "start": {
+ "character": 26,
+ "line": 12,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 35,
+ "line": 11,
+ },
+ "start": {
+ "character": 32,
+ "line": 11,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 29,
+ "line": 11,
+ },
+ "start": {
+ "character": 26,
+ "line": 11,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 29,
+ "line": 9,
+ },
+ "start": {
+ "character": 26,
+ "line": 9,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 29,
+ "line": 8,
+ },
+ "start": {
+ "character": 26,
+ "line": 8,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('Component props', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/foo.vue', 'vue', `
+
+
+
+
+
+
+ `);
+ expect(
+ await requestRename('tsconfigProject/fixture.vue', 'vue', `
+
+ {{ aaaBbb }}
+
+
+
+ `, 'cccDdd')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/tsconfigProject/fixture.vue": [
+ {
+ "newText": "cccDdd",
+ "range": {
+ "end": {
+ "character": 24,
+ "line": 6,
+ },
+ "start": {
+ "character": 18,
+ "line": 6,
+ },
+ },
+ },
+ {
+ "newText": "cccDdd",
+ "range": {
+ "end": {
+ "character": 14,
+ "line": 2,
+ },
+ "start": {
+ "character": 8,
+ "line": 2,
+ },
+ },
+ },
+ ],
+ "file://\${testWorkspacePath}/tsconfigProject/foo.vue": [
+ {
+ "newText": "cccDdd",
+ "range": {
+ "end": {
+ "character": 17,
+ "line": 3,
+ },
+ "start": {
+ "character": 11,
+ "line": 3,
+ },
+ },
+ },
+ {
+ "newText": "ccc-ddd",
+ "range": {
+ "end": {
+ "character": 18,
+ "line": 2,
+ },
+ "start": {
+ "character": 11,
+ "line": 2,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('Component type props', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ await prepareDocument('tsconfigProject/foo.vue', 'vue', `
+
+
+
+
+
+
+ `);
+ expect(
+ await requestRename('tsconfigProject/fixture.vue', 'vue', `
+
+ {{ aaaBbb }}
+
+
+
+ `, 'cccDdd')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/tsconfigProject/fixture.vue": [
+ {
+ "newText": "cccDdd",
+ "range": {
+ "end": {
+ "character": 14,
+ "line": 2,
+ },
+ "start": {
+ "character": 8,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "cccDdd",
+ "range": {
+ "end": {
+ "character": 24,
+ "line": 6,
+ },
+ "start": {
+ "character": 18,
+ "line": 6,
+ },
+ },
+ },
+ ],
+ "file://\${testWorkspacePath}/tsconfigProject/foo.vue": [
+ {
+ "newText": "cccDdd",
+ "range": {
+ "end": {
+ "character": 17,
+ "line": 3,
+ },
+ "start": {
+ "character": 11,
+ "line": 3,
+ },
+ },
+ },
+ {
+ "newText": "ccc-ddd",
+ "range": {
+ "end": {
+ "character": 18,
+ "line": 2,
+ },
+ "start": {
+ "character": 11,
+ "line": 2,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('Component dynamic props', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestRename('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+ `, 'bar')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/tsconfigProject/fixture.vue": [
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 13,
+ "line": 6,
+ },
+ "start": {
+ "character": 10,
+ "line": 6,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 15,
+ "line": 2,
+ },
+ "start": {
+ "character": 12,
+ "line": 2,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('Component returns', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestRename('tsconfigProject/fixture.vue', 'vue', `
+
+ {{ foo| }}
+
+
+
+ `, 'bar')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/tsconfigProject/fixture.vue": [
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 11,
+ "line": 2,
+ },
+ "start": {
+ "character": 8,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 10,
+ "line": 11,
+ },
+ "start": {
+ "character": 7,
+ "line": 11,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('
+ `, 'bar')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/tsconfigProject/fixture.vue": [
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 13,
+ "line": 6,
+ },
+ "start": {
+ "character": 10,
+ "line": 6,
+ },
+ },
+ },
+ {
+ "newText": "bar",
+ "range": {
+ "end": {
+ "character": 11,
+ "line": 2,
+ },
+ "start": {
+ "character": 8,
+ "line": 2,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ it('Component tags', async () => {
+ await ensureGlobalTypesHolder('tsconfigProject');
+ expect(
+ await requestRename('tsconfigProject/fixture.vue', 'vue', `
+
+
+
+
+
+
+ `, 'CcDd')
+ ).toMatchInlineSnapshot(`
+ {
+ "changes": {
+ "file://\${testWorkspacePath}/tsconfigProject/fixture.vue": [
+ {
+ "newText": "cc-dd",
+ "range": {
+ "end": {
+ "character": 19,
+ "line": 3,
+ },
+ "start": {
+ "character": 14,
+ "line": 3,
+ },
+ },
+ },
+ {
+ "newText": "cc-dd",
+ "range": {
+ "end": {
+ "character": 11,
+ "line": 3,
+ },
+ "start": {
+ "character": 6,
+ "line": 3,
+ },
+ },
+ },
+ {
+ "newText": "CcDd",
+ "range": {
+ "end": {
+ "character": 17,
+ "line": 2,
+ },
+ "start": {
+ "character": 13,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "CcDd",
+ "range": {
+ "end": {
+ "character": 10,
+ "line": 2,
+ },
+ "start": {
+ "character": 6,
+ "line": 2,
+ },
+ },
+ },
+ {
+ "newText": "CcDd",
+ "range": {
+ "end": {
+ "character": 15,
+ "line": 7,
+ },
+ "start": {
+ "character": 11,
+ "line": 7,
+ },
+ },
+ },
+ ],
+ },
+ }
+ `);
+ });
+
+ const openedDocuments: TextDocument[] = [];
+
+ afterEach(async () => {
+ const server = await getLanguageServer();
+ for (const document of openedDocuments) {
+ await server.closeTextDocument(document.uri);
+ }
+ openedDocuments.length = 0;
+ });
+
+ /**
+ * @deprecated Remove this when #4717 fixed.
+ */
+ async function ensureGlobalTypesHolder(folderName: string) {
+ const document = await prepareDocument(`${folderName}/globalTypesHolder.vue`, 'vue', '');
+ const server = await getLanguageServer();
+ await server.sendDocumentDiagnosticRequest(document.uri);
+ }
+
+ async function requestRename(fileName: string, languageId: string, _content: string, newName: string) {
+ const offset = _content.indexOf('|');
+ expect(offset).toBeGreaterThanOrEqual(0);
+ const content = _content.slice(0, offset) + _content.slice(offset + 1);
+
+ const server = await getLanguageServer();
+ let document = await prepareDocument(fileName, languageId, content);
+
+ const position = document.positionAt(offset);
+ const edit = await server.sendRenameRequest(document.uri, position, newName);
+ expect(edit).toBeDefined();
+
+ for (const [uri, edits] of Object.entries(edit!.changes!)) {
+ delete edit!.changes![uri];
+ edit!.changes![uri.replace(testWorkspacePath, '${testWorkspacePath}')] = edits;
+ }
+
+ return edit;
+ }
+
+ async function prepareDocument(fileName: string, languageId: string, content: string) {
+ const server = await getLanguageServer();
+ const uri = URI.file(`${testWorkspacePath}/${fileName}`);
+ const document = await server.openInMemoryDocument(uri.toString(), languageId, content);
+ if (openedDocuments.every(d => d.uri !== document.uri)) {
+ openedDocuments.push(document);
+ }
+ return document;
+ }
+});
diff --git a/packages/language-server/tests/server.ts b/packages/language-server/tests/server.ts
new file mode 100644
index 0000000000..13b4464e0f
--- /dev/null
+++ b/packages/language-server/tests/server.ts
@@ -0,0 +1,43 @@
+import { ConfigurationRequest, PublishDiagnosticsNotification } from '@volar/language-server';
+import type { LanguageServerHandle } from '@volar/test-utils';
+import { startLanguageServer } from '@volar/test-utils';
+import * as path from 'path';
+import { URI } from 'vscode-uri';
+
+let serverHandle: LanguageServerHandle | undefined;
+
+export const testWorkspacePath = path.resolve(__dirname, '../../../test-workspace');
+
+export async function getLanguageServer() {
+ if (!serverHandle) {
+ serverHandle = startLanguageServer(require.resolve('../bin/vue-language-server.js'), testWorkspacePath);
+ serverHandle.connection.onNotification(PublishDiagnosticsNotification.type, () => { });
+ serverHandle.connection.onRequest(ConfigurationRequest.type, ({ items }) => {
+ return items.map(({ section }) => {
+ if (section?.startsWith('vue.inlayHints.')) {
+ return true;
+ }
+ return null;
+ });
+ });
+
+ await serverHandle.initialize(
+ URI.file(testWorkspacePath).toString(),
+ {
+ typescript: {
+ tsdk: path.dirname(require.resolve('typescript/lib/typescript.js')),
+ disableAutoImportCache: true,
+ },
+ vue: {
+ hybridMode: false,
+ },
+ },
+ {
+ workspace: {
+ configuration: true,
+ },
+ }
+ );
+ }
+ return serverHandle;
+}
diff --git a/packages/language-service/index.ts b/packages/language-service/index.ts
index 42fef932bc..122442fa92 100644
--- a/packages/language-service/index.ts
+++ b/packages/language-service/index.ts
@@ -45,9 +45,12 @@ declare module '@volar/language-service' {
}
}
-export function getFullLanguageServicePlugins(ts: typeof import('typescript')): LanguageServicePlugin[] {
+export function getFullLanguageServicePlugins(
+ ts: typeof import('typescript'),
+ { disableAutoImportCache }: { disableAutoImportCache?: boolean; } = {}
+): LanguageServicePlugin[] {
const plugins: LanguageServicePlugin[] = [
- ...createTypeScriptPlugins(ts),
+ ...createTypeScriptPlugins(ts, { disableAutoImportCache }),
...getCommonLanguageServicePlugins(
ts,
getTsPluginClientForLSP
diff --git a/packages/language-service/tests/complete.ts b/packages/language-service/tests/complete.ts
deleted file mode 100644
index 582287949d..0000000000
--- a/packages/language-service/tests/complete.ts
+++ /dev/null
@@ -1,118 +0,0 @@
-import * as fs from 'fs';
-import * as path from 'path';
-import { describe, expect, it } from 'vitest';
-import type * as vscode from 'vscode-languageserver-protocol';
-import { TextDocument } from 'vscode-languageserver-textdocument';
-import { tester } from './utils/createTester';
-import { fileNameToUri } from './utils/mockEnv';
-
-const baseDir = path.resolve(__dirname, '../../../test-workspace/language-service/complete');
-const testDirs = fs.readdirSync(baseDir);
-const getLineText = (text: string, line: number) => text.replace(/\r\n/g, '\n').split('\n')[line];
-
-for (const dirName of testDirs) {
-
- describe(`complete: ${dirName}`, async () => {
-
- const dir = path.join(baseDir, dirName);
- const inputFiles = readFiles(path.join(dir, 'input'));
- const outputFiles = readFiles(path.join(dir, 'output'));
-
- for (const file in inputFiles) {
-
- const filePath = path.join(dir, 'input', file);
- const uri = fileNameToUri(filePath);
- const fileText = inputFiles[file];
- const document = TextDocument.create('', '', 0, fileText);
- const actions = findCompleteActions(fileText);
-
- const expectedFileText = outputFiles[file];
-
- for (const action of actions) {
-
- const position = document.positionAt(action.offset);
-
- position.line--;
-
- const location = `${filePath}:${position.line + 1}:${position.character + 1}`;
-
- it(`${location} => ${action.label}`, async () => {
-
- expect(expectedFileText).toBeDefined();
-
- let complete = await tester.languageService.getCompletionItems(
- uri,
- position,
- { triggerKind: 1 satisfies typeof vscode.CompletionTriggerKind.Invoked }
- );
-
- if (!complete.items.length) {
- // fix #2511 test case, it's a bug of TS 5.3
- complete = await tester.languageService.getCompletionItems(
- uri,
- position,
- { triggerKind: 1 satisfies typeof vscode.CompletionTriggerKind.Invoked }
- );
- }
-
- let item = complete.items.find(item => item.label === action.label)!;
-
- expect(item).toBeDefined();
-
- item = await tester.languageService.resolveCompletionItem(item);
-
- let edits: vscode.TextEdit[] = [];
-
- if (item.textEdit) {
- if ('replace' in item.textEdit) {
- edits.push({ range: item.textEdit.replace, newText: item.textEdit.newText });
- }
- else {
- edits.push(item.textEdit);
- }
- }
- else {
- edits.push({ range: { start: position, end: position }, newText: item.insertText ?? item.label });
- }
-
- if (item.additionalTextEdits) {
- edits = edits.concat(item.additionalTextEdits);
- }
-
- let result = TextDocument.applyEdits(TextDocument.create('', '', 0, fileText), edits);
-
- result = result.replace(/\$0/g, '').replace(/\$1/g, '');
-
- expect(getLineText(result, position.line)).toBe(getLineText(expectedFileText, position.line));
- });
- }
- }
- });
-}
-
-function readFiles(dir: string) {
-
- const filesText: Record = {};
- const files = fs.readdirSync(dir);
-
- for (const file of files) {
- const filePath = path.join(dir, file);
- filesText[file] = fs.readFileSync(filePath, 'utf8');
- }
-
- return filesText;
-}
-
-function findCompleteActions(text: string) {
-
- return [...text.matchAll(/(\^*)complete:\s*([\S]*)/g)].map(flag => {
-
- const offset = flag.index;
- const label = flag[2];
-
- return {
- offset,
- label,
- };
- });
-}
diff --git a/packages/language-service/tests/findDefinition.ts b/packages/language-service/tests/findDefinition.ts
deleted file mode 100644
index c359d44e3b..0000000000
--- a/packages/language-service/tests/findDefinition.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import * as fs from 'fs';
-import * as path from 'path';
-import { describe, expect, it } from 'vitest';
-import { TextDocument } from 'vscode-languageserver-textdocument';
-import { tester } from './utils/createTester';
-import { fileNameToUri } from './utils/mockEnv';
-
-const baseDir = path.resolve(__dirname, '../../../test-workspace/language-service/find-definition');
-const testDirs = fs.readdirSync(baseDir);
-
-for (const dirName of testDirs) {
-
- describe(`find definition: ${dirName}`, async () => {
-
- const dir = path.join(baseDir, dirName);
- const inputFiles = readFiles(dir);
-
- for (const file in inputFiles) {
-
- const filePath = path.join(dir, file);
- const uri = fileNameToUri(filePath);
- const fileText = inputFiles[file];
- const document = TextDocument.create('', '', 0, fileText);
- const actions = findActions(fileText);
-
- for (const action of actions) {
-
- const position = document.positionAt(action.offset);
-
- position.line--;
-
- const targetFile = path.resolve(dir, action.targetFile);
- const targetDocument = TextDocument.create('', '', 0, fs.readFileSync(targetFile, 'utf8'));
-
- it(`${filePath}:${position.line + 1}:${position.character + 1} => ${targetFile}:${action.targeRange.start}`, async () => {
-
- const locations = await tester.languageService.getDefinition(
- uri,
- position
- );
-
- expect(locations).toBeDefined();
-
- const location = locations?.find(loc =>
- loc.targetUri === fileNameToUri(targetFile).toString()
- && targetDocument.offsetAt(loc.targetSelectionRange.start) === action.targeRange.start
- && targetDocument.offsetAt(loc.targetSelectionRange.end) === action.targeRange.end
- );
-
- if (!location) {
- console.log(JSON.stringify(locations, null, 2));
- console.log(action.targeRange);
- }
-
- expect(location).toBeDefined();
- });
- }
- }
- });
-}
-
-function readFiles(dir: string) {
-
- const filesText: Record = {};
- const files = fs.readdirSync(dir);
-
- for (const file of files) {
- const filePath = path.join(dir, file);
- filesText[file] = fs.readFileSync(filePath, 'utf8');
- }
-
- return filesText;
-}
-
-const definitionReg = /(\^*)definition:\s*([\S]*),\s*([\S]*),\s*([\S]*)/g;
-
-function findActions(text: string) {
-
- return [...text.matchAll(definitionReg)].map(flag => {
-
- const offset = flag.index;
- const targetFile = flag[2];
- const targeRange = {
- start: Number(flag[3]),
- end: Number(flag[4]),
- };
-
- return {
- offset,
- targetFile,
- targeRange,
- };
- });
-}
diff --git a/packages/language-service/tests/index.spec.ts b/packages/language-service/tests/index.spec.ts
deleted file mode 100644
index d06f93278c..0000000000
--- a/packages/language-service/tests/index.spec.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import './complete';
-import './findDefinition';
-import './rename';
-import './reference';
-import './inlayHint';
diff --git a/packages/language-service/tests/inlayHint.ts b/packages/language-service/tests/inlayHint.ts
deleted file mode 100644
index 47a4acc65f..0000000000
--- a/packages/language-service/tests/inlayHint.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import * as fs from 'fs';
-import * as path from 'path';
-import { describe, expect, it } from 'vitest';
-import { Range } from 'vscode-languageserver-protocol';
-import { TextDocument } from 'vscode-languageserver-textdocument';
-import { tester } from './utils/createTester';
-import { fileNameToUri } from './utils/mockEnv';
-
-const baseDir = path.resolve(__dirname, '../../../test-workspace/language-service/inlay-hint');
-const testDirs = fs.readdirSync(baseDir);
-
-for (const dirName of testDirs) {
-
- describe(`inlay hint: ${dirName}`, async () => {
-
- const dir = path.join(baseDir, dirName);
- const inputFiles = readFiles(dir);
-
- for (const file in inputFiles) {
-
- const filePath = path.join(dir, file);
- const uri = fileNameToUri(filePath);
- const fileText = inputFiles[file];
- const document = TextDocument.create('', '', 0, fileText);
- const actions = findActions(fileText);
-
- for (const action of actions) {
-
- const position = document.positionAt(action.offset);
-
- position.line--;
-
- const range = Range.create(position, { ...position, character: position.character + 1 });
-
- const location = `${filePath}:${position.line + 1}:${position.character + 1}`;
-
- it(`${location}`, async () => {
-
- const inlayHints = await tester.languageService.getInlayHints(
- uri,
- range
- );
-
- const inlayHint = inlayHints?.find(inlayHint => inlayHint.label === action.label);
-
- expect(inlayHint).toBeDefined();
- });
- }
- }
- });
-}
-
-function readFiles(dir: string) {
-
- const filesText: Record = {};
- const files = fs.readdirSync(dir);
-
- for (const file of files) {
- const filePath = path.join(dir, file);
- filesText[file] = fs.readFileSync(filePath, 'utf8');
- }
-
- return filesText;
-}
-
-const inlayHintReg = /(\^*)inlayHint:\s*"(.+)"/g;
-
-function findActions(text: string) {
-
- return [...text.matchAll(inlayHintReg)].map(flag => {
-
- const offset = flag.index;
- const label = flag[2];
-
- return {
- offset,
- label
- };
- });
-}
diff --git a/packages/language-service/tests/reference.ts b/packages/language-service/tests/reference.ts
deleted file mode 100644
index d7fab82f3b..0000000000
--- a/packages/language-service/tests/reference.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import * as fs from 'fs';
-import * as path from 'path';
-import { describe, expect, it } from 'vitest';
-import { TextDocument } from 'vscode-languageserver-textdocument';
-import { tester } from './utils/createTester';
-import { fileNameToUri } from './utils/mockEnv';
-
-const baseDir = path.resolve(__dirname, '../../../test-workspace/language-service/reference');
-const testDirs = fs.readdirSync(baseDir);
-
-for (const dirName of testDirs) {
-
- describe(`find reference: ${dirName}`, async () => {
-
- const dir = path.join(baseDir, dirName);
- const inputFiles = readFiles(dir);
-
- for (const file in inputFiles) {
-
- const filePath = path.join(dir, file);
- const uri = fileNameToUri(filePath);
- const fileText = inputFiles[file];
- const document = TextDocument.create('', '', 0, fileText);
- const actions = findActions(fileText);
-
- for (const action of actions) {
-
- const position = document.positionAt(action.offset);
-
- position.line--;
-
- const location = `${filePath}:${position.line + 1}:${position.character + 1}`;
-
- it(`${location} => count: ${action.count}`, async () => {
-
- const locations = await tester.languageService.getReferences(
- uri,
- position,
- { includeDeclaration: true }
- );
-
- expect(locations).toBeDefined();
-
- expect(locations?.length).toBe(action.count);
- });
- }
- }
- });
-}
-
-function readFiles(dir: string) {
-
- const filesText: Record = {};
- const files = fs.readdirSync(dir);
-
- for (const file of files) {
- const filePath = path.join(dir, file);
- filesText[file] = fs.readFileSync(filePath, 'utf8');
- }
-
- return filesText;
-}
-
-const referenceReg = /(\^*)reference:\s*([\S]*)/g;
-
-function findActions(text: string) {
-
- return [...text.matchAll(referenceReg)].map(flag => {
-
- const offset = flag.index;
- // The definition itself is also counted
- const count = Number(flag[2]) + 1;
-
- return {
- offset,
- count,
- };
- });
-}
diff --git a/packages/language-service/tests/rename.ts b/packages/language-service/tests/rename.ts
deleted file mode 100644
index b3655b0ab4..0000000000
--- a/packages/language-service/tests/rename.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-import * as fs from 'fs';
-import * as path from 'path';
-import { describe, expect, it } from 'vitest';
-import { TextDocument } from 'vscode-languageserver-textdocument';
-import { tester } from './utils/createTester';
-import { fileNameToUri } from './utils/mockEnv';
-
-const baseDir = path.resolve(__dirname, '../../../test-workspace/language-service/rename');
-const testDirs = fs.readdirSync(baseDir);
-
-for (const dirName of testDirs) {
-
- describe(`rename: ${dirName}`, async () => {
-
- const dir = path.join(baseDir, dirName);
- const inputFiles = readFiles(path.join(dir, 'input'));
- const outputFiles = readFiles(path.join(dir, 'output'));
-
- for (const file in inputFiles) {
-
- const filePath = path.join(dir, 'input', file);
- const uri = fileNameToUri(filePath);
- const fileText = inputFiles[file];
- const document = TextDocument.create('', '', 0, fileText);
- const actions = findRenameActions(fileText);
-
- for (const action of actions) {
-
- for (let offset = action.start; offset <= action.end; offset++) {
-
- const position = document.positionAt(offset);
-
- position.line--;
-
- const location = `${filePath}:${position.line + 1}:${position.character + 1}`;
-
- it(`${location} => ${action.newName}`, async () => {
-
- const edit = await tester.languageService.getRenameEdits(
- uri,
- position,
- action.newName
- );
-
- expect(edit).toBeDefined();
-
- const tempFiles = { ...inputFiles };
-
- for (const uri in edit!.changes) {
- for (const file in tempFiles) {
- if (uri.endsWith(file)) {
- tempFiles[file] = TextDocument.applyEdits(TextDocument.create('', '', 0, tempFiles[file]), edit!.changes[uri]);
- }
- }
- }
-
- expect(Object.keys(tempFiles).length).toBe(Object.keys(outputFiles).length);
-
- for (const file in tempFiles) {
- expect(tempFiles[file]).toBe(outputFiles[file]);
- }
- });
- }
- }
-
- }
- });
-}
-
-function readFiles(dir: string) {
-
- const filesText: Record = {};
- const files = fs.readdirSync(dir);
-
- for (const file of files) {
- const filePath = path.join(dir, file);
- filesText[file] = fs.readFileSync(filePath, 'utf8');
- }
-
- return filesText;
-}
-
-const renameReg = /(\^*)rename:\s*([\S]*)/g;
-
-function findRenameActions(text: string) {
-
- return [...text.matchAll(renameReg)].map(flag => {
-
- const start = flag.index;
- const end = start + flag[1].length;
- const newName = flag[2];
-
- return {
- start,
- end,
- newName,
- };
- });
-}
diff --git a/packages/language-service/tests/utils/createTester.ts b/packages/language-service/tests/utils/createTester.ts
deleted file mode 100644
index e0c9e6f017..0000000000
--- a/packages/language-service/tests/utils/createTester.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-import { ProjectContext, createLanguage, createLanguageService, createUriMap } from '@volar/language-service';
-import { TypeScriptProjectHost, createLanguageServiceHost, resolveFileLanguageId } from '@volar/typescript';
-import * as path from 'path';
-import * as ts from 'typescript';
-import { URI } from 'vscode-uri';
-import { createParsedCommandLine, createRootFileChecker, createVueLanguagePlugin2, getFullLanguageServicePlugins } from '../..';
-import { createMockServiceEnv, fileNameToUri, uriToFileName } from './mockEnv';
-
-export const rootUri = URI.file(path.resolve(__dirname, '../../../../test-workspace/language-service'));
-export const tester = createTester(rootUri);
-
-function createTester(rootUri: URI) {
-
- const serviceEnv = createMockServiceEnv(rootUri, () => currentVSCodeSettings ?? defaultVSCodeSettings);
- const rootPath = uriToFileName(rootUri);
- const realTsConfig = path.join(rootPath, 'tsconfig.json').replace(/\\/g, '/');
- const parsedCommandLine = createParsedCommandLine(ts, ts.sys, realTsConfig);
- parsedCommandLine.fileNames = parsedCommandLine.fileNames.map(fileName => fileName.replace(/\\/g, '/'));
- const scriptSnapshots = new Map();
- const projectHost: TypeScriptProjectHost = {
- getCurrentDirectory: () => uriToFileName(rootUri),
- getProjectVersion: () => '0',
- getScriptFileNames: () => parsedCommandLine.fileNames,
- getCompilationSettings: () => parsedCommandLine.options,
- };
- const vueLanguagePlugin = createVueLanguagePlugin2(
- ts,
- uriToFileName,
- createRootFileChecker(
- projectHost.getProjectVersion ? () => projectHost.getProjectVersion!() : undefined,
- () => projectHost.getScriptFileNames(),
- ts.sys.useCaseSensitiveFileNames
- ),
- parsedCommandLine.options,
- parsedCommandLine.vueOptions
- );
- const vueServicePlugins = getFullLanguageServicePlugins(ts);
- const defaultVSCodeSettings: any = {
- 'typescript.preferences.quoteStyle': 'single',
- 'javascript.preferences.quoteStyle': 'single',
- 'vue.inlayHints.destructuredProps': true,
- 'vue.inlayHints.missingProps': true,
- 'vue.inlayHints.optionsWrapper': true,
- 'vue.inlayHints.inlineHandlerLeading': true,
- };
- let currentVSCodeSettings: any;
- const language = createLanguage(
- [
- vueLanguagePlugin,
- {
- getLanguageId(uri) {
- return resolveFileLanguageId(uri.fsPath);
- },
- },
- ],
- createUriMap(),
- uri => {
- const snapshot = getScriptSnapshot(uriToFileName(uri));
- if (snapshot) {
- language.scripts.set(uri, snapshot);
- }
- else {
- language.scripts.delete(uri);
- }
- }
- );
- const project: ProjectContext = {};
- project.typescript = {
- configFileName: realTsConfig,
- sys: ts.sys,
- uriConverter: {
- asFileName: uriToFileName,
- asUri: fileNameToUri,
- },
- ...createLanguageServiceHost(ts, ts.sys, language, fileNameToUri, projectHost),
- };
- project.vue = {
- compilerOptions: parsedCommandLine.vueOptions,
- };
- const languageService = createLanguageService(language, vueServicePlugins, serviceEnv, project);
-
- return {
- serviceEnv,
- projectHost,
- languageService,
- setVSCodeSettings,
- };
-
- function setVSCodeSettings(settings: any = undefined) {
- currentVSCodeSettings = settings;
- }
- function getScriptSnapshot(fileName: string) {
- const snapshot = scriptSnapshots.get(fileName);
- if (snapshot) {
- return snapshot;
- }
- const text = getScriptText(fileName);
- if (text !== undefined) {
- const snapshot = ts.ScriptSnapshot.fromString(text);
- scriptSnapshots.set(fileName, snapshot);
- return snapshot;
- }
- }
- function getScriptText(fileName: string) {
- if (ts.sys.fileExists(fileName)) {
- return ts.sys.readFile(fileName, 'utf8');
- }
- }
-}
diff --git a/packages/language-service/tests/utils/mockEnv.ts b/packages/language-service/tests/utils/mockEnv.ts
deleted file mode 100644
index 2f642fe373..0000000000
--- a/packages/language-service/tests/utils/mockEnv.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { FileType, LanguageServiceEnvironment } from '@volar/language-service';
-import { URI } from 'vscode-uri';
-import * as fs from 'fs';
-
-export const uriToFileName = (uri: URI) => uri.fsPath.replace(/\\/g, '/');
-
-export const fileNameToUri = (fileName: string) => URI.file(fileName);
-
-export function createMockServiceEnv(
- rootUri: URI,
- getSettings = () => ({} as any)
-): LanguageServiceEnvironment {
- return {
- workspaceFolders: [rootUri],
- getConfiguration(section: string) {
- const settings = getSettings();
- if (settings[section]) {
- return settings[section];
- }
- let result: Record | undefined;
- for (const key in settings) {
- if (key.startsWith(section + '.')) {
- const newKey = key.slice(section.length + 1);
- result ??= {};
- result[newKey] = settings[key];
- }
- }
- return result;
- },
- fs: {
- stat(uri) {
- if (uri.scheme === 'file') {
- try {
- const stats = fs.statSync(uriToFileName(uri), { throwIfNoEntry: false });
- if (stats) {
- return {
- type: stats.isFile() ? FileType.File
- : stats.isDirectory() ? FileType.Directory
- : stats.isSymbolicLink() ? FileType.SymbolicLink
- : FileType.Unknown,
- ctime: stats.ctimeMs,
- mtime: stats.mtimeMs,
- size: stats.size,
- };
- }
- }
- catch {
- return undefined;
- }
- }
- },
- readFile(uri, encoding) {
- if (uri.scheme === 'file') {
- try {
- return fs.readFileSync(uriToFileName(uri), { encoding: encoding as 'utf-8' ?? 'utf-8' });
- }
- catch {
- return undefined;
- }
- }
- },
- readDirectory(uri) {
- if (uri.scheme === 'file') {
- try {
- const dirName = uriToFileName(uri);
- const files = fs.readdirSync(dirName, { withFileTypes: true });
- return files.map<[string, FileType]>(file => {
- return [file.name, file.isFile() ? FileType.File
- : file.isDirectory() ? FileType.Directory
- : file.isSymbolicLink() ? FileType.SymbolicLink
- : FileType.Unknown];
- });
- }
- catch {
- return [];
- }
- }
- return [];
- },
- }
- };
-}
diff --git a/packages/typescript-plugin/lib/requests/collectExtractProps.ts b/packages/typescript-plugin/lib/requests/collectExtractProps.ts
index 5b785f6478..9d31da27de 100644
--- a/packages/typescript-plugin/lib/requests/collectExtractProps.ts
+++ b/packages/typescript-plugin/lib/requests/collectExtractProps.ts
@@ -1,5 +1,4 @@
import { VueVirtualCode, isSemanticTokensEnabled } from '@vue/language-core';
-import type * as ts from 'typescript';
import type { RequestContext } from './types';
export function collectExtractProps(
@@ -19,11 +18,7 @@ export function collectExtractProps(
type: string;
model: boolean;
}>();
- const program: ts.Program = (languageService as any).getCurrentProgram();
- if (!program) {
- return;
- }
-
+ const program = languageService.getProgram()!;
const sourceFile = program.getSourceFile(fileName)!;
const checker = program.getTypeChecker();
const script = volarFile.generated?.languagePlugin.typescript?.getServiceScript(volarFile.generated.root);
diff --git a/packages/typescript-plugin/lib/requests/componentInfos.ts b/packages/typescript-plugin/lib/requests/componentInfos.ts
index 145a9e2e18..cb069cb09e 100644
--- a/packages/typescript-plugin/lib/requests/componentInfos.ts
+++ b/packages/typescript-plugin/lib/requests/componentInfos.ts
@@ -15,11 +15,7 @@ export function getComponentProps(
return;
}
const vueCode = volarFile.generated.root;
- const program: ts.Program = (languageService as any).getCurrentProgram();
- if (!program) {
- return;
- }
-
+ const program = languageService.getProgram()!;
const checker = program.getTypeChecker();
const components = getVariableType(ts, languageService, vueCode, '__VLS_components');
if (!components) {
@@ -97,11 +93,7 @@ export function getComponentEvents(
return;
}
const vueCode = volarFile.generated.root;
- const program: ts.Program = (languageService as any).getCurrentProgram();
- if (!program) {
- return;
- }
-
+ const program = languageService.getProgram()!;
const checker = program.getTypeChecker();
const components = getVariableType(ts, languageService, vueCode, '__VLS_components');
if (!components) {
@@ -221,10 +213,7 @@ export function getElementAttrs(
if (!(volarFile?.generated?.root instanceof vue.VueVirtualCode)) {
return;
}
- const program: ts.Program = (languageService as any).getCurrentProgram();
- if (!program) {
- return;
- }
+ const program = languageService.getProgram()!;
let tsSourceFile: ts.SourceFile | undefined;
@@ -251,14 +240,11 @@ export function getElementAttrs(
function getVariableType(
ts: typeof import('typescript'),
- tsLs: ts.LanguageService,
+ languageService: ts.LanguageService,
vueCode: vue.VueVirtualCode,
name: string
) {
- const program: ts.Program = (tsLs as any).getCurrentProgram();
- if (!program) {
- return;
- }
+ const program = languageService.getProgram()!;
let tsSourceFile: ts.SourceFile | undefined;
diff --git a/packages/typescript-plugin/lib/requests/getPropertiesAtLocation.ts b/packages/typescript-plugin/lib/requests/getPropertiesAtLocation.ts
index 6713546d69..834e4ebe6b 100644
--- a/packages/typescript-plugin/lib/requests/getPropertiesAtLocation.ts
+++ b/packages/typescript-plugin/lib/requests/getPropertiesAtLocation.ts
@@ -37,12 +37,7 @@ export function getPropertiesAtLocation(
}
}
-
- const program: ts.Program = (languageService as any).getCurrentProgram();
- if (!program) {
- return;
- }
-
+ const program = languageService.getProgram()!;
const sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
return;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index af9786a46f..df1fd94061 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5,6 +5,15 @@ settings:
excludeLinksFromLockfile: false
overrides:
+ '@volar/kit': https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee
+ '@volar/language-core': https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
+ '@volar/language-server': https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
+ '@volar/source-map': https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee
+ '@volar/test-utils': https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee
+ '@volar/typescript': https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
+ '@volar/vscode': https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee
+ volar-service-typescript: https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed
inquirer: 9.2.23
importers:
@@ -24,8 +33,8 @@ importers:
specifier: latest
version: 1.0.14
'@volar/language-service':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
typescript:
specifier: latest
version: 5.5.3
@@ -45,8 +54,8 @@ importers:
specifier: ^1.82.0
version: 1.91.0
'@volar/vscode':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee
'@vscode/vsce':
specifier: latest
version: 3.0.0
@@ -75,8 +84,8 @@ importers:
packages/component-meta:
dependencies:
'@volar/typescript':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
'@vue/language-core':
specifier: 2.0.28
version: link:../language-core
@@ -102,8 +111,8 @@ importers:
packages/language-core:
dependencies:
'@volar/language-core':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
'@vue/compiler-dom':
specifier: ^3.4.0
version: 3.4.31
@@ -139,8 +148,8 @@ importers:
specifier: ^1.0.1
version: 1.0.2
'@volar/typescript':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
'@vue/compiler-sfc':
specifier: ^3.4.0
version: 3.4.31
@@ -148,8 +157,8 @@ importers:
packages/language-plugin-pug:
dependencies:
'@volar/source-map':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee
volar-service-pug:
specifier: 0.0.61
version: 0.0.61
@@ -164,11 +173,14 @@ importers:
packages/language-server:
dependencies:
'@volar/language-core':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
'@volar/language-server':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee
+ '@volar/test-utils':
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee
'@vue/language-core':
specifier: 2.0.28
version: link:../language-core
@@ -188,14 +200,14 @@ importers:
packages/language-service:
dependencies:
'@volar/language-core':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
'@volar/language-service':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
'@volar/typescript':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
'@vue/compiler-dom':
specifier: ^3.4.0
version: 3.4.31
@@ -216,28 +228,28 @@ importers:
version: 1.0.1
volar-service-css:
specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ version: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
volar-service-emmet:
specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ version: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
volar-service-html:
specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ version: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
volar-service-json:
specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ version: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
volar-service-pug:
specifier: 0.0.61
version: 0.0.61
volar-service-pug-beautify:
specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ version: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
volar-service-typescript:
- specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ specifier: https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed
+ version: https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
volar-service-typescript-twoslash-queries:
specifier: 0.0.61
- version: 0.0.61(@volar/language-service@2.4.0)
+ version: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
vscode-html-languageservice:
specifier: ^5.2.0
version: 5.3.0
@@ -255,8 +267,8 @@ importers:
specifier: latest
version: 1.0.2
'@volar/kit':
- specifier: ~2.4.0
- version: 2.4.0(typescript@5.5.3)
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee(typescript@5.5.3)
vscode-languageserver-protocol:
specifier: ^3.17.5
version: 3.17.5
@@ -264,8 +276,8 @@ importers:
packages/tsc:
dependencies:
'@volar/typescript':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
'@vue/language-core':
specifier: 2.0.28
version: link:../language-core
@@ -283,8 +295,8 @@ importers:
packages/typescript-plugin:
dependencies:
'@volar/typescript':
- specifier: ~2.4.0
- version: 2.4.0
+ specifier: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
+ version: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
'@vue/language-core':
specifier: 2.0.28
version: link:../language-core
@@ -1091,28 +1103,39 @@ packages:
'@vitest/utils@2.0.3':
resolution: {integrity: sha512-c/UdELMuHitQbbc/EVctlBaxoYAwQPQdSNwv7z/vHyBKy2edYZaFgptE27BRueZB7eW8po+cllotMNTDpL3HWg==}
- '@volar/kit@2.4.0':
- resolution: {integrity: sha512-uqwtPKhrbnP+3f8hs+ltDYXLZ6Wdbs54IzkaPocasI4aBhqWLht5qXctE1MqpZU52wbH359E0u9nhxEFmyon+w==}
+ '@volar/kit@https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee}
+ version: 2.4.0
peerDependencies:
typescript: '*'
- '@volar/language-core@2.4.0':
- resolution: {integrity: sha512-FTla+khE+sYK0qJP+6hwPAAUwiNHVMph4RUXpxf/FIPKUP61NFrVZorml4mjFShnueR2y9/j8/vnh09YwVdH7A==}
+ '@volar/language-core@https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee}
+ version: 2.4.0
+
+ '@volar/language-server@https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee}
+ version: 2.4.0
- '@volar/language-server@2.4.0':
- resolution: {integrity: sha512-rmGIjAxWekWQiGH97Mosb4juiD/hfFYNQKV5Py9r7vDOLSkbIwRhITbwHm88NJKs8P6TNc6w/PfBXN6yjKadJg==}
+ '@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee}
+ version: 2.4.0
- '@volar/language-service@2.4.0':
- resolution: {integrity: sha512-4P3yeQXIL68mLfS3n6P3m02IRg3GnLHUU9k/1PCHEfm5FG9bySkDOc72dbBn2vAa2BxOqm18bmmZXrsWuQ5AOw==}
+ '@volar/source-map@https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee}
+ version: 2.4.0
- '@volar/source-map@2.4.0':
- resolution: {integrity: sha512-2ceY8/NEZvN6F44TXw2qRP6AQsvCYhV2bxaBPWxV9HqIfkbRydSksTFObCF1DBDNBfKiZTS8G/4vqV6cvjdOIQ==}
+ '@volar/test-utils@https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee}
+ version: 2.4.0
- '@volar/typescript@2.4.0':
- resolution: {integrity: sha512-9zx3lQWgHmVd+JRRAHUSRiEhe4TlzL7U7e6ulWXOxHH/WNYxzKwCvZD7WYWEZFdw4dHfTD9vUR0yPQO6GilCaQ==}
+ '@volar/typescript@https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee}
+ version: 2.4.0
- '@volar/vscode@2.4.0':
- resolution: {integrity: sha512-VOnUgtmu+xGOqVKouRM8ZSeVOFPqmcTDfi3wif5peXpkOPsCgNdS/zns0xunuh9J6Ck5SV+QffPfmNW9XARnxw==}
+ '@volar/vscode@https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee':
+ resolution: {tarball: https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee}
+ version: 2.4.0
'@vscode/emmet-helper@2.9.3':
resolution: {integrity: sha512-rB39LHWWPQYYlYfpv9qCoZOVioPCftKXXqrsyqN1mTWZM6dTnONT63Db+03vgrBbHzJN45IrgS/AGxw9iiqfEw==}
@@ -3275,40 +3298,45 @@ packages:
volar-service-css@0.0.61:
resolution: {integrity: sha512-Ct9L/w+IB1JU8F4jofcNCGoHy6TF83aiapfZq9A0qYYpq+Kk5dH+ONS+rVZSsuhsunq8UvAuF8Gk6B8IFLfniw==}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
volar-service-emmet@0.0.61:
resolution: {integrity: sha512-iiYqBxjjcekqrRruw4COQHZME6EZYWVbkHjHDbULpml3g8HGJHzpAMkj9tXNCPxf36A+f1oUYjsvZt36qPg4cg==}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
volar-service-html@0.0.61:
resolution: {integrity: sha512-yFE+YmmgqIL5HI4ORqP++IYb1QaGcv+xBboI0WkCxJJ/M35HZj7f5rbT3eQ24ECLXFbFCFanckwyWJVz5KmN3Q==}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
volar-service-json@0.0.61:
resolution: {integrity: sha512-9PpEib6XE99gFjjjl8IkITktSvfPW39jFAGsHggT6SdlIb8zC7J0+rMjkyVUAUOpWvY5jPqkByX43LcxZvkrdQ==}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
volar-service-pug-beautify@0.0.61:
resolution: {integrity: sha512-FvZEZJdZ64pa3a0u1Urz08g4gHjuPcdMsEsJGiDLYqJnIZEGZRyhHUjSxfmAxihZCzp738W90tOMQDbgeQMGhA==}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
@@ -3318,16 +3346,18 @@ packages:
volar-service-typescript-twoslash-queries@0.0.61:
resolution: {integrity: sha512-99FICGrEF0r1E2tV+SvprHPw9Knyg7BdW2fUch0tf59kG+KG+Tj4tL6tUg+cy8f23O/VXlmsWFMIE+bx1dXPnQ==}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
- volar-service-typescript@0.0.61:
- resolution: {integrity: sha512-4kRHxVbW7wFBHZWRU6yWxTgiKETBDIJNwmJUAWeP0mHaKpnDGj/astdRFKqGFRYVeEYl45lcUPhdJyrzanjsdQ==}
+ volar-service-typescript@https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed:
+ resolution: {tarball: https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed}
+ version: 0.0.61
peerDependencies:
- '@volar/language-service': ~2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
peerDependenciesMeta:
'@volar/language-service':
optional: true
@@ -4350,24 +4380,24 @@ snapshots:
loupe: 3.1.1
tinyrainbow: 1.2.0
- '@volar/kit@2.4.0(typescript@5.5.3)':
+ '@volar/kit@https://pkg.pr.new/volarjs/volar.js/@volar/kit@28cbdee(typescript@5.5.3)':
dependencies:
- '@volar/language-service': 2.4.0
- '@volar/typescript': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
+ '@volar/typescript': https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
typesafe-path: 0.2.2
typescript: 5.5.3
vscode-languageserver-textdocument: 1.0.11
vscode-uri: 3.0.8
- '@volar/language-core@2.4.0':
+ '@volar/language-core@https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee':
dependencies:
- '@volar/source-map': 2.4.0
+ '@volar/source-map': https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee
- '@volar/language-server@2.4.0':
+ '@volar/language-server@https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee':
dependencies:
- '@volar/language-core': 2.4.0
- '@volar/language-service': 2.4.0
- '@volar/typescript': 2.4.0
+ '@volar/language-core': https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
+ '@volar/typescript': https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee
path-browserify: 1.0.1
request-light: 0.7.0
vscode-languageserver: 9.0.1
@@ -4375,24 +4405,31 @@ snapshots:
vscode-languageserver-textdocument: 1.0.11
vscode-uri: 3.0.8
- '@volar/language-service@2.4.0':
+ '@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee':
dependencies:
- '@volar/language-core': 2.4.0
+ '@volar/language-core': https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
vscode-languageserver-protocol: 3.17.5
vscode-languageserver-textdocument: 1.0.11
vscode-uri: 3.0.8
- '@volar/source-map@2.4.0': {}
+ '@volar/source-map@https://pkg.pr.new/volarjs/volar.js/@volar/source-map@28cbdee': {}
+
+ '@volar/test-utils@https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@28cbdee':
+ dependencies:
+ '@volar/language-core': https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
+ '@volar/language-server': https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee
+ vscode-languageserver-textdocument: 1.0.11
+ vscode-uri: 3.0.8
- '@volar/typescript@2.4.0':
+ '@volar/typescript@https://pkg.pr.new/volarjs/volar.js/@volar/typescript@28cbdee':
dependencies:
- '@volar/language-core': 2.4.0
+ '@volar/language-core': https://pkg.pr.new/volarjs/volar.js/@volar/language-core@28cbdee
path-browserify: 1.0.1
vscode-uri: 3.0.8
- '@volar/vscode@2.4.0':
+ '@volar/vscode@https://pkg.pr.new/volarjs/volar.js/@volar/vscode@28cbdee':
dependencies:
- '@volar/language-server': 2.4.0
+ '@volar/language-server': https://pkg.pr.new/volarjs/volar.js/@volar/language-server@28cbdee
path-browserify: 1.0.1
vscode-languageclient: 9.0.1
vscode-nls: 5.2.0
@@ -6754,61 +6791,61 @@ snapshots:
- supports-color
- terser
- volar-service-css@0.0.61(@volar/language-service@2.4.0):
+ volar-service-css@0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
vscode-css-languageservice: 6.3.0
vscode-languageserver-textdocument: 1.0.11
vscode-uri: 3.0.8
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
- volar-service-emmet@0.0.61(@volar/language-service@2.4.0):
+ volar-service-emmet@0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
'@emmetio/css-parser': 0.4.0
'@emmetio/html-matcher': 1.3.0
'@vscode/emmet-helper': 2.9.3
vscode-uri: 3.0.8
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
- volar-service-html@0.0.61(@volar/language-service@2.4.0):
+ volar-service-html@0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
vscode-html-languageservice: 5.3.0
vscode-languageserver-textdocument: 1.0.11
vscode-uri: 3.0.8
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
- volar-service-json@0.0.61(@volar/language-service@2.4.0):
+ volar-service-json@0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
vscode-json-languageservice: 5.4.0
vscode-uri: 3.0.8
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
- volar-service-pug-beautify@0.0.61(@volar/language-service@2.4.0):
+ volar-service-pug-beautify@0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
'@johnsoncodehk/pug-beautify': 0.2.2
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
volar-service-pug@0.0.61:
dependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
muggle-string: 0.4.1
pug-lexer: 5.0.1
pug-parser: 6.0.0
- volar-service-html: 0.0.61(@volar/language-service@2.4.0)
+ volar-service-html: 0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee)
vscode-html-languageservice: 5.3.0
vscode-languageserver-textdocument: 1.0.11
- volar-service-typescript-twoslash-queries@0.0.61(@volar/language-service@2.4.0):
+ volar-service-typescript-twoslash-queries@0.0.61(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
vscode-uri: 3.0.8
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
- volar-service-typescript@0.0.61(@volar/language-service@2.4.0):
+ volar-service-typescript@https://pkg.pr.new/volarjs/services/volar-service-typescript@177b9ed(@volar/language-service@https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee):
dependencies:
path-browserify: 1.0.1
semver: 7.6.2
@@ -6817,7 +6854,7 @@ snapshots:
vscode-nls: 5.2.0
vscode-uri: 3.0.8
optionalDependencies:
- '@volar/language-service': 2.4.0
+ '@volar/language-service': https://pkg.pr.new/volarjs/volar.js/@volar/language-service@28cbdee
vscode-css-languageservice@6.3.0:
dependencies:
diff --git a/test-workspace/language-service/complete/#2454/input/entry.vue b/test-workspace/language-service/complete/#2454/input/entry.vue
deleted file mode 100644
index 5fd9768ec3..0000000000
--- a/test-workspace/language-service/complete/#2454/input/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/#2454/output/entry.vue b/test-workspace/language-service/complete/#2454/output/entry.vue
deleted file mode 100644
index 0680fd0fe9..0000000000
--- a/test-workspace/language-service/complete/#2454/output/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/#2511/input/component-for-auto-import.vue b/test-workspace/language-service/complete/#2511/input/component-for-auto-import.vue
deleted file mode 100644
index 6b4c19a058..0000000000
--- a/test-workspace/language-service/complete/#2511/input/component-for-auto-import.vue
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/#2511/input/entry.vue b/test-workspace/language-service/complete/#2511/input/entry.vue
deleted file mode 100644
index 8f093eed73..0000000000
--- a/test-workspace/language-service/complete/#2511/input/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/#2511/output/entry.vue b/test-workspace/language-service/complete/#2511/output/entry.vue
deleted file mode 100644
index 223cf4517a..0000000000
--- a/test-workspace/language-service/complete/#2511/output/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/#3658/input/entry.vue b/test-workspace/language-service/complete/#3658/input/entry.vue
deleted file mode 100644
index fc9eb31456..0000000000
--- a/test-workspace/language-service/complete/#3658/input/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- {{ fo }}
-
-
-
-
diff --git a/test-workspace/language-service/complete/#3658/output/entry.vue b/test-workspace/language-service/complete/#3658/output/entry.vue
deleted file mode 100644
index b8aa2161b7..0000000000
--- a/test-workspace/language-service/complete/#3658/output/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- {{ foo }}
-
-
-
-
diff --git a/test-workspace/language-service/complete/#4639/input/entry.vue b/test-workspace/language-service/complete/#4639/input/entry.vue
deleted file mode 100644
index 730350bee7..0000000000
--- a/test-workspace/language-service/complete/#4639/input/entry.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/#4639/output/entry.vue b/test-workspace/language-service/complete/#4639/output/entry.vue
deleted file mode 100644
index f470a01d83..0000000000
--- a/test-workspace/language-service/complete/#4639/output/entry.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/$event/input/entry.vue b/test-workspace/language-service/complete/$event/input/entry.vue
deleted file mode 100644
index c8ee6a19cc..0000000000
--- a/test-workspace/language-service/complete/$event/input/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/test-workspace/language-service/complete/$event/output/entry.vue b/test-workspace/language-service/complete/$event/output/entry.vue
deleted file mode 100644
index 0d0cfecd3f..0000000000
--- a/test-workspace/language-service/complete/$event/output/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/test-workspace/language-service/complete/component-auto-import/input/component-for-auto-import.vue b/test-workspace/language-service/complete/component-auto-import/input/component-for-auto-import.vue
deleted file mode 100644
index 6b4c19a058..0000000000
--- a/test-workspace/language-service/complete/component-auto-import/input/component-for-auto-import.vue
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/component-auto-import/input/entry.vue b/test-workspace/language-service/complete/component-auto-import/input/entry.vue
deleted file mode 100644
index dac432aed0..0000000000
--- a/test-workspace/language-service/complete/component-auto-import/input/entry.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/component-auto-import/output/entry.vue b/test-workspace/language-service/complete/component-auto-import/output/entry.vue
deleted file mode 100644
index 1072e574b6..0000000000
--- a/test-workspace/language-service/complete/component-auto-import/output/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/core#8811/input/entry.vue b/test-workspace/language-service/complete/core#8811/input/entry.vue
deleted file mode 100644
index 68b817417a..0000000000
--- a/test-workspace/language-service/complete/core#8811/input/entry.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/core#8811/output/entry.vue b/test-workspace/language-service/complete/core#8811/output/entry.vue
deleted file mode 100644
index e6ed09a9ae..0000000000
--- a/test-workspace/language-service/complete/core#8811/output/entry.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/directives/input/entry.vue b/test-workspace/language-service/complete/directives/input/entry.vue
deleted file mode 100644
index 7608ec9344..0000000000
--- a/test-workspace/language-service/complete/directives/input/entry.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/complete/directives/output/entry.vue b/test-workspace/language-service/complete/directives/output/entry.vue
deleted file mode 100644
index 4800a2ef2f..0000000000
--- a/test-workspace/language-service/complete/directives/output/entry.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/complete/script-setup/input/entry.vue b/test-workspace/language-service/complete/script-setup/input/entry.vue
deleted file mode 100644
index 6db91e021e..0000000000
--- a/test-workspace/language-service/complete/script-setup/input/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{ f }}
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/complete/script-setup/output/entry.vue b/test-workspace/language-service/complete/script-setup/output/entry.vue
deleted file mode 100644
index 279f132f53..0000000000
--- a/test-workspace/language-service/complete/script-setup/output/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{ foo }}
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/complete/slot-name/input/main.vue b/test-workspace/language-service/complete/slot-name/input/main.vue
deleted file mode 100644
index 8d71f0755c..0000000000
--- a/test-workspace/language-service/complete/slot-name/input/main.vue
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/slot-name/output/main.vue b/test-workspace/language-service/complete/slot-name/output/main.vue
deleted file mode 100644
index 574449504f..0000000000
--- a/test-workspace/language-service/complete/slot-name/output/main.vue
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/test-workspace/language-service/complete/vue-file-path/input/alias-path.vue b/test-workspace/language-service/complete/vue-file-path/input/alias-path.vue
deleted file mode 100644
index c3f2edbf7e..0000000000
--- a/test-workspace/language-service/complete/vue-file-path/input/alias-path.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/vue-file-path/input/component.vue b/test-workspace/language-service/complete/vue-file-path/input/component.vue
deleted file mode 100644
index 6b4c19a058..0000000000
--- a/test-workspace/language-service/complete/vue-file-path/input/component.vue
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/vue-file-path/input/relative-path.vue b/test-workspace/language-service/complete/vue-file-path/input/relative-path.vue
deleted file mode 100644
index b568bfed5b..0000000000
--- a/test-workspace/language-service/complete/vue-file-path/input/relative-path.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/vue-file-path/output/alias-path.vue b/test-workspace/language-service/complete/vue-file-path/output/alias-path.vue
deleted file mode 100644
index 5d293a39d1..0000000000
--- a/test-workspace/language-service/complete/vue-file-path/output/alias-path.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/complete/vue-file-path/output/relative-path.vue b/test-workspace/language-service/complete/vue-file-path/output/relative-path.vue
deleted file mode 100644
index 5dcd613e80..0000000000
--- a/test-workspace/language-service/complete/vue-file-path/output/relative-path.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/find-definition/#2600/entry.vue b/test-workspace/language-service/find-definition/#2600/entry.vue
deleted file mode 100644
index a39313dd73..0000000000
--- a/test-workspace/language-service/find-definition/#2600/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/test-workspace/language-service/find-definition/#2600/foo.vue b/test-workspace/language-service/find-definition/#2600/foo.vue
deleted file mode 100644
index 35fd4030f5..0000000000
--- a/test-workspace/language-service/find-definition/#2600/foo.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
- {{ msg }}
-
-
-
diff --git a/test-workspace/language-service/find-definition/alias-path/entry.vue b/test-workspace/language-service/find-definition/alias-path/entry.vue
deleted file mode 100644
index 0df2ffefbb..0000000000
--- a/test-workspace/language-service/find-definition/alias-path/entry.vue
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/test-workspace/language-service/find-definition/alias-path/foo.ts b/test-workspace/language-service/find-definition/alias-path/foo.ts
deleted file mode 100644
index 3329a7d972..0000000000
--- a/test-workspace/language-service/find-definition/alias-path/foo.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const foo = 'foo';
diff --git a/test-workspace/language-service/find-definition/ts-to-vue/component.vue b/test-workspace/language-service/find-definition/ts-to-vue/component.vue
deleted file mode 100644
index 6b4c19a058..0000000000
--- a/test-workspace/language-service/find-definition/ts-to-vue/component.vue
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test-workspace/language-service/find-definition/ts-to-vue/entry.ts b/test-workspace/language-service/find-definition/ts-to-vue/entry.ts
deleted file mode 100644
index d3e3c899c0..0000000000
--- a/test-workspace/language-service/find-definition/ts-to-vue/entry.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import Component from './component.vue';
- // ^definition: ./component.vue, 0, 0
-import Component from './component.vue';
- // ^definition: ./component.vue, 0, 0
diff --git a/test-workspace/language-service/inlay-hint/destructured-props/entry.vue b/test-workspace/language-service/inlay-hint/destructured-props/entry.vue
deleted file mode 100644
index abc2c07f58..0000000000
--- a/test-workspace/language-service/inlay-hint/destructured-props/entry.vue
+++ /dev/null
@@ -1,52 +0,0 @@
-
\ No newline at end of file
diff --git a/test-workspace/language-service/inlay-hint/inline-handler-leading/entry.vue b/test-workspace/language-service/inlay-hint/inline-handler-leading/entry.vue
deleted file mode 100644
index 56026683aa..0000000000
--- a/test-workspace/language-service/inlay-hint/inline-handler-leading/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/inlay-hint/missing-props/Comp.vue b/test-workspace/language-service/inlay-hint/missing-props/Comp.vue
deleted file mode 100644
index 2cf8ee629f..0000000000
--- a/test-workspace/language-service/inlay-hint/missing-props/Comp.vue
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/test-workspace/language-service/inlay-hint/missing-props/entry.vue b/test-workspace/language-service/inlay-hint/missing-props/entry.vue
deleted file mode 100644
index 670696c726..0000000000
--- a/test-workspace/language-service/inlay-hint/missing-props/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/test-workspace/language-service/inlay-hint/option-wrapper/entry.vue b/test-workspace/language-service/inlay-hint/option-wrapper/entry.vue
deleted file mode 100644
index ae02ba0771..0000000000
--- a/test-workspace/language-service/inlay-hint/option-wrapper/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
\ No newline at end of file
diff --git a/test-workspace/language-service/reference/slot-default/entry.vue b/test-workspace/language-service/reference/slot-default/entry.vue
deleted file mode 100644
index a09b7689aa..0000000000
--- a/test-workspace/language-service/reference/slot-default/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/test-workspace/language-service/reference/slot-default/foo.vue b/test-workspace/language-service/reference/slot-default/foo.vue
deleted file mode 100644
index 91ed6dfe33..0000000000
--- a/test-workspace/language-service/reference/slot-default/foo.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
diff --git a/test-workspace/language-service/reference/slot-named/entry.vue b/test-workspace/language-service/reference/slot-named/entry.vue
deleted file mode 100644
index b4f17d8bc7..0000000000
--- a/test-workspace/language-service/reference/slot-named/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/test-workspace/language-service/reference/slot-named/foo.vue b/test-workspace/language-service/reference/slot-named/foo.vue
deleted file mode 100644
index 0add3c2b7a..0000000000
--- a/test-workspace/language-service/reference/slot-named/foo.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/test-workspace/language-service/reference/v-bind-shorthand/child.vue b/test-workspace/language-service/reference/v-bind-shorthand/child.vue
deleted file mode 100644
index 51b389e379..0000000000
--- a/test-workspace/language-service/reference/v-bind-shorthand/child.vue
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/test-workspace/language-service/reference/v-bind-shorthand/entry.vue b/test-workspace/language-service/reference/v-bind-shorthand/entry.vue
deleted file mode 100644
index 5f9a43593c..0000000000
--- a/test-workspace/language-service/reference/v-bind-shorthand/entry.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
diff --git a/test-workspace/language-service/rename/#2410/input/entry.vue b/test-workspace/language-service/rename/#2410/input/entry.vue
deleted file mode 100644
index 899d61b095..0000000000
--- a/test-workspace/language-service/rename/#2410/input/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/test-workspace/language-service/rename/#2410/output/entry.vue b/test-workspace/language-service/rename/#2410/output/entry.vue
deleted file mode 100644
index 98c4da87c6..0000000000
--- a/test-workspace/language-service/rename/#2410/output/entry.vue
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/test-workspace/language-service/rename/component-prop/input/component.vue b/test-workspace/language-service/rename/component-prop/input/component.vue
deleted file mode 100644
index 1927ea488c..0000000000
--- a/test-workspace/language-service/rename/component-prop/input/component.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{ aaaBbb }}
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-prop/input/entry.vue b/test-workspace/language-service/rename/component-prop/input/entry.vue
deleted file mode 100644
index bbbb4de943..0000000000
--- a/test-workspace/language-service/rename/component-prop/input/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-prop/output/component.vue b/test-workspace/language-service/rename/component-prop/output/component.vue
deleted file mode 100644
index c2c6ae66c4..0000000000
--- a/test-workspace/language-service/rename/component-prop/output/component.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{ cccDdd }}
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-prop/output/entry.vue b/test-workspace/language-service/rename/component-prop/output/entry.vue
deleted file mode 100644
index 6c8426c210..0000000000
--- a/test-workspace/language-service/rename/component-prop/output/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-tag/input/component.vue b/test-workspace/language-service/rename/component-tag/input/component.vue
deleted file mode 100644
index bc692573ed..0000000000
--- a/test-workspace/language-service/rename/component-tag/input/component.vue
+++ /dev/null
@@ -1,2 +0,0 @@
-
diff --git a/test-workspace/language-service/rename/component-tag/input/entry.vue b/test-workspace/language-service/rename/component-tag/input/entry.vue
deleted file mode 100644
index fc092f4a40..0000000000
--- a/test-workspace/language-service/rename/component-tag/input/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-tag/output/component.vue b/test-workspace/language-service/rename/component-tag/output/component.vue
deleted file mode 100644
index bc692573ed..0000000000
--- a/test-workspace/language-service/rename/component-tag/output/component.vue
+++ /dev/null
@@ -1,2 +0,0 @@
-
diff --git a/test-workspace/language-service/rename/component-tag/output/entry.vue b/test-workspace/language-service/rename/component-tag/output/entry.vue
deleted file mode 100644
index 1d104e4130..0000000000
--- a/test-workspace/language-service/rename/component-tag/output/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-type-prop/input/component.vue b/test-workspace/language-service/rename/component-type-prop/input/component.vue
deleted file mode 100644
index 092840f2d0..0000000000
--- a/test-workspace/language-service/rename/component-type-prop/input/component.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{ aaaBbb }}
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-type-prop/input/entry.vue b/test-workspace/language-service/rename/component-type-prop/input/entry.vue
deleted file mode 100644
index bbbb4de943..0000000000
--- a/test-workspace/language-service/rename/component-type-prop/input/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-type-prop/output/component.vue b/test-workspace/language-service/rename/component-type-prop/output/component.vue
deleted file mode 100644
index 540e4f2c81..0000000000
--- a/test-workspace/language-service/rename/component-type-prop/output/component.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{ cccDdd }}
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/component-type-prop/output/entry.vue b/test-workspace/language-service/rename/component-type-prop/output/entry.vue
deleted file mode 100644
index 6c8426c210..0000000000
--- a/test-workspace/language-service/rename/component-type-prop/output/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/css-module/input/entry.vue b/test-workspace/language-service/rename/css-module/input/entry.vue
deleted file mode 100644
index de45f0f390..0000000000
--- a/test-workspace/language-service/rename/css-module/input/entry.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/css-module/output/entry.vue b/test-workspace/language-service/rename/css-module/output/entry.vue
deleted file mode 100644
index 86b15434ce..0000000000
--- a/test-workspace/language-service/rename/css-module/output/entry.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/css-scoped/input/entry.vue b/test-workspace/language-service/rename/css-scoped/input/entry.vue
deleted file mode 100644
index a1cee689ed..0000000000
--- a/test-workspace/language-service/rename/css-scoped/input/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/css-scoped/output/entry.vue b/test-workspace/language-service/rename/css-scoped/output/entry.vue
deleted file mode 100644
index 662a634665..0000000000
--- a/test-workspace/language-service/rename/css-scoped/output/entry.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/css-vars/input/entry.vue b/test-workspace/language-service/rename/css-vars/input/entry.vue
deleted file mode 100644
index d5243c4f62..0000000000
--- a/test-workspace/language-service/rename/css-vars/input/entry.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/css-vars/output/entry.vue b/test-workspace/language-service/rename/css-vars/output/entry.vue
deleted file mode 100644
index 356c312f92..0000000000
--- a/test-workspace/language-service/rename/css-vars/output/entry.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/dynamic-prop/input/entry.vue b/test-workspace/language-service/rename/dynamic-prop/input/entry.vue
deleted file mode 100644
index 27273ad7af..0000000000
--- a/test-workspace/language-service/rename/dynamic-prop/input/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/dynamic-prop/output/entry.vue b/test-workspace/language-service/rename/dynamic-prop/output/entry.vue
deleted file mode 100644
index 6b7618d004..0000000000
--- a/test-workspace/language-service/rename/dynamic-prop/output/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/regular-component/input/entry.vue b/test-workspace/language-service/rename/regular-component/input/entry.vue
deleted file mode 100644
index d48540a7f5..0000000000
--- a/test-workspace/language-service/rename/regular-component/input/entry.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
- {{ foo }}
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/regular-component/output/entry.vue b/test-workspace/language-service/rename/regular-component/output/entry.vue
deleted file mode 100644
index 9fb7b7f589..0000000000
--- a/test-workspace/language-service/rename/regular-component/output/entry.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
- {{ bar }}
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/script-setup/input/entry.vue b/test-workspace/language-service/rename/script-setup/input/entry.vue
deleted file mode 100644
index f61a482552..0000000000
--- a/test-workspace/language-service/rename/script-setup/input/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
- {{ foo }}
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/rename/script-setup/output/entry.vue b/test-workspace/language-service/rename/script-setup/output/entry.vue
deleted file mode 100644
index 5a819003ef..0000000000
--- a/test-workspace/language-service/rename/script-setup/output/entry.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
- {{ bar }}
-
-
-
-
\ No newline at end of file
diff --git a/test-workspace/language-service/tsconfig.json b/test-workspace/language-service/tsconfig.json
deleted file mode 100644
index 133cb386d9..0000000000
--- a/test-workspace/language-service/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "exclude": "../tsconfig.json",
- "compilerOptions": {
- "paths": {
- "__COMPLETE_ROOT__/*": [
- "./complete/*"
- ],
- "__FIND_DEFINITION_ROOT__/*": [
- "./find-definition/*"
- ]
- },
- },
- "include": [ "**/*" ],
-}
\ No newline at end of file
diff --git a/test-workspace/tsconfigProject/empty.vue b/test-workspace/tsconfigProject/empty.vue
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/test-workspace/tsconfigProject/tsconfig.json b/test-workspace/tsconfigProject/tsconfig.json
new file mode 100644
index 0000000000..885d9a3f6e
--- /dev/null
+++ b/test-workspace/tsconfigProject/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "exclude": [ "../tsconfig.json" ],
+ "include": [ "**/*" ],
+ "compilerOptions": {
+ "paths": {
+ "@/*": [ "./*" ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/vitest.config.ts b/vitest.config.ts
index 7f9fdf64dd..4ae993ab38 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -3,8 +3,8 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
poolOptions: {
- threads: {
- singleThread: true,
+ forks: {
+ singleFork: true,
isolate: false,
},
},