Skip to content

Commit 631249c

Browse files
committed
feat: volar 2.x
1 parent 6ccdf56 commit 631249c

File tree

6 files changed

+406
-261
lines changed

6 files changed

+406
-261
lines changed

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@
7979
"@types/node": "^20.11.25",
8080
"@typescript-eslint/eslint-plugin": "^7.1.1",
8181
"@vitejs/plugin-vue": "^5.0.4",
82-
"@volar/cdn": "~1.11.1",
83-
"@volar/monaco": "~1.11.1",
84-
"@volar/typescript": "~1.11.1",
85-
"@vue/language-service": "1.9.0-alpha.3",
82+
"@volar/monaco": "~2.1.0",
83+
"@volar/typescript": "~2.1.0",
84+
"@vue/language-service": "2.0.1",
8685
"bumpp": "^9.4.0",
8786
"codemirror": "^5.65.16",
8887
"conventional-changelog-cli": "^4.1.0",
@@ -101,5 +100,11 @@
101100
"vite-plugin-dts": "^3.7.3",
102101
"vue": "^3.4.21",
103102
"vue-tsc": "^2.0.6"
103+
},
104+
"pnpm": {
105+
"patchedDependencies": {
106+
"@volar/[email protected]": "patches/@[email protected]",
107+
108+
}
104109
}
105110
}

patches/@[email protected]

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/lib/ata.js b/lib/ata.js
2+
index e0a03eb1b4d923e66fb92405eced8b618074ce02..272e905d50ca2da0d777b4f78a9200b481ee5811 100644
3+
--- a/lib/ata.js
4+
+++ b/lib/ata.js
5+
@@ -32,21 +32,21 @@ export function activateAutomaticTypeAcquisition(env, onFetch) {
6+
};
7+
}
8+
if (fileName.startsWith('/node_modules/')) {
9+
- const path = uri.substring('/node_modules/'.length);
10+
+ const path = fileName.substring('/node_modules/'.length);
11+
return await _stat(path);
12+
}
13+
},
14+
async readFile(uri) {
15+
const fileName = env.typescript.uriToFileName(uri);
16+
if (fileName.startsWith('/node_modules/')) {
17+
- const path = uri.substring('/node_modules/'.length);
18+
+ const path = fileName.substring('/node_modules/'.length);
19+
return await _readFile(path);
20+
}
21+
},
22+
async readDirectory(uri) {
23+
const fileName = env.typescript.uriToFileName(uri);
24+
if (fileName.startsWith('/node_modules/')) {
25+
- const path = uri.substring('/node_modules/'.length);
26+
+ const path = fileName.substring('/node_modules/'.length);
27+
return _readDirectory(path);
28+
}
29+
return [];
30+
@@ -185,10 +185,10 @@ export function activateAutomaticTypeAcquisition(env, onFetch) {
31+
const parts = path.split('/');
32+
let pkgName = parts[0];
33+
if (pkgName.startsWith('@')) {
34+
- if (parts.length < 2 || !parts[1]) {
35+
+ if (!parts[1]) {
36+
return undefined;
37+
}
38+
- pkgName += '/' + parts[2];
39+
+ pkgName += '/' + parts[1];
40+
}
41+
return pkgName;
42+
}

patches/@[email protected]

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/lib/utils.js b/lib/utils.js
2+
index 7f144fe51e4f28eb778d2fc7ce5d3e71f46a9131..a0f4e041f47c3452de4b790299725f7daa88f0ee 100644
3+
--- a/lib/utils.js
4+
+++ b/lib/utils.js
5+
@@ -1,7 +1,7 @@
6+
"use strict";
7+
Object.defineProperty(exports, "__esModule", { value: true });
8+
exports.getProject = exports.projects = exports.pipeTable = void 0;
9+
-exports.pipeTable = process.platform === 'win32'
10+
+exports.pipeTable = false
11+
? `\\\\.\\pipe\\vue-tsp-table.json`
12+
: `/tmp/vue-tsp-table.json`;
13+
exports.projects = new Map();

0 commit comments

Comments
 (0)