Skip to content

Commit de487c1

Browse files
committed
fix: build command failed with pnpm v7
close #1261
1 parent 7b5cea0 commit de487c1

File tree

7 files changed

+92
-262
lines changed

7 files changed

+92
-262
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"typescript.format.semicolons": "insert",
33
"editor.insertSpaces": false,
4-
"editor.detectIndentation": false
4+
"editor.detectIndentation": false,
5+
"typescript.tsdk": "node_modules/typescript/lib"
56
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
"chrome": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=./extensions/vscode-vue-language-features ../volar-starter"
1515
},
1616
"devDependencies": {
17+
"@types/node": "latest",
1718
"@vscode/test-web": "latest",
1819
"lerna": "latest",
1920
"typescript": "latest",
20-
"vitest": "^0.8.4"
21+
"vite": "latest",
22+
"vitest": "latest"
2123
}
2224
}

packages/preview/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
"volar-preview-vite": "./bin/vite.js",
1818
"volar-preview-nuxi": "./bin/nuxi.js"
1919
},
20+
"devDependencies": {
21+
"@types/ws": "^8.5.3"
22+
},
2023
"dependencies": {
21-
"ws": "^8.5.0"
24+
"ws": "^8.6.0"
2225
}
2326
}

packages/shared/src/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import type * as vscode from 'vscode-languageserver-types';
2+
import type * as vscode from 'vscode-languageserver-protocol';
33
import type { TextDocument } from 'vscode-languageserver-textdocument';
44

55
export function sleep(ms: number) {

packages/vue-language-service/src/plugins/json.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ export default function (options: {
1919
triggerCharacters: ['"', ':'],
2020

2121
on(document, position, context) {
22-
return worker(document, (jsonDocument) => {
23-
return jsonLs.doComplete(document, position, jsonDocument);
22+
return worker(document, async (jsonDocument) => {
23+
return await jsonLs.doComplete(document, position, jsonDocument);
2424
});
2525
},
2626

27-
resolve(item) {
28-
return jsonLs.doResolve(item);
27+
async resolve(item) {
28+
return await jsonLs.doResolve(item);
2929
},
3030
},
3131

3232
definition: {
3333

3434
on(document, position) {
35-
return worker(document, (jsonDocument) => {
36-
return jsonLs.findDefinition(document, position, jsonDocument);
35+
return worker(document, async (jsonDocument) => {
36+
return await jsonLs.findDefinition(document, position, jsonDocument);
3737
});
3838
},
3939
},
@@ -43,55 +43,55 @@ export default function (options: {
4343

4444
const documentLanguageSettings = undefined; // await getSettings(); // TODO
4545

46-
return jsonLs.doValidation(document, jsonDocument, documentLanguageSettings, options.schema) as Promise<vscode.Diagnostic[]>;
46+
return await jsonLs.doValidation(document, jsonDocument, documentLanguageSettings, options.schema) as vscode.Diagnostic[];
4747
});
4848
},
4949

5050
doHover(document, position) {
51-
return worker(document, (jsonDocument) => {
52-
return jsonLs.doHover(document, position, jsonDocument);
51+
return worker(document, async (jsonDocument) => {
52+
return await jsonLs.doHover(document, position, jsonDocument);
5353
});
5454
},
5555

5656
findDocumentLinks(document) {
57-
return worker(document, (jsonDocument) => {
58-
return jsonLs.findLinks(document, jsonDocument);
57+
return worker(document, async (jsonDocument) => {
58+
return await jsonLs.findLinks(document, jsonDocument);
5959
});
6060
},
6161

6262
findDocumentSymbols(document) {
63-
return worker(document, (jsonDocument) => {
64-
return jsonLs.findDocumentSymbols(document, jsonDocument);
63+
return worker(document, async (jsonDocument) => {
64+
return await jsonLs.findDocumentSymbols(document, jsonDocument);
6565
});
6666
},
6767

6868
findDocumentColors(document) {
69-
return worker(document, (jsonDocument) => {
70-
return jsonLs.findDocumentColors(document, jsonDocument);
69+
return worker(document, async (jsonDocument) => {
70+
return await jsonLs.findDocumentColors(document, jsonDocument);
7171
});
7272
},
7373

7474
getColorPresentations(document, color, range) {
75-
return worker(document, (jsonDocument) => {
76-
return jsonLs.getColorPresentations(document, jsonDocument, color, range);
75+
return worker(document, async (jsonDocument) => {
76+
return await jsonLs.getColorPresentations(document, jsonDocument, color, range);
7777
});
7878
},
7979

8080
getFoldingRanges(document) {
81-
return worker(document, (jsonDocument) => {
82-
return jsonLs.getFoldingRanges(document);
81+
return worker(document, async (jsonDocument) => {
82+
return await jsonLs.getFoldingRanges(document);
8383
});
8484
},
8585

8686
getSelectionRanges(document, positions) {
87-
return worker(document, (jsonDocument) => {
88-
return jsonLs.getSelectionRanges(document, positions, jsonDocument);
87+
return worker(document, async (jsonDocument) => {
88+
return await jsonLs.getSelectionRanges(document, positions, jsonDocument);
8989
});
9090
},
9191

9292
format(document, range, options) {
93-
return worker(document, (jsonDocument) => {
94-
return jsonLs.format(document, range, options);
93+
return worker(document, async (jsonDocument) => {
94+
return await jsonLs.format(document, range, options);
9595
});
9696
},
9797
};

0 commit comments

Comments
 (0)