Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support installing the vscode extension on the web version of vscode #302

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint/eslint-plugin",
Expand Down Expand Up @@ -101,7 +102,8 @@
"match": false
}
}
]
],
"@typescript-eslint/no-floating-promises": "error"
},
"overrides": [
{
Expand Down
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
]
},
{
"name": "Pyright extension (web)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/packages/vscode-pyright/dist/extension.js",
"preLaunchTask": "npm: build:extension:dev",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-pyright",
"--extensionDevelopmentKind=web",
// The published extension is named "detachhead.basedpyright", but in debug mode it's "ms-pyright.vscode-pyright"
// to allow the extension code to participate in the lerna monorepo. Make sure that the published extension
// isn't enabled, otherwise both are loaded and conflict.
"--disable-extension=detachhead.basedpyright"
],
"smartStep": true,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
]
},
{
"name": "Pyright extension (watch)",
"type": "extensionHost",
Expand Down
2 changes: 1 addition & 1 deletion build/updateDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ async function main() {
]);
}

main();
void main();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"fix:eslint": "eslint --fix .",
"check:prettier": "prettier -c .",
"fix:prettier": "prettier --write .",
"typecheck": "npx lerna exec --stream --no-bail --ignore=pyright -- tsc --noEmit",
"typecheck": "npx lerna exec --stream --no-bail -- tsc --noEmit",
"run:cli:windows": "npm run build:cli:dev && node packages/pyright/index.js --pythonpath .venv/Scripts/python.exe",
"run:cli:unix": "npm run build:cli:dev && node packages/pyright/index.js --pythonpath .venv/bin/python"
},
Expand Down
1 change: 1 addition & 0 deletions packages/pyright-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@types/lodash": "^4.14.202",
"@types/node": "^17.0.45",
"@types/tmp": "^0.2.6",
"@types/vscode": "^1.88.0",
"copy-webpack-plugin": "^11.0.0",
"esbuild-loader": "^3.2.0",
"jest": "^29.7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/pyright-internal/src/analyzer/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ export class Checker extends ParseTreeWalker {
return true;
}

override visitImportFromAs(node: ImportFromAsNode): boolean {
override async visitImportFromAs(node: ImportFromAsNode): Promise<boolean> {
if (this._fileInfo.isStubFile) {
return false;
}
Expand All @@ -1624,7 +1624,7 @@ export class Checker extends ParseTreeWalker {
continue;
}

const importResult = this._getImportResult(node, resolvedAliasUri);
const importResult = await this._getImportResult(node, resolvedAliasUri);
if (!importResult) {
continue;
}
Expand Down
Loading
Loading