Skip to content

Commit

Permalink
Fix configure project context command + upgrade to pico-mpy-com v1.0.15
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 10, 2024
1 parent 884b5f2 commit defde8f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@
"typescript-eslint": "^8.3.0"
},
"dependencies": {
"@paulober/pico-mpy-com": "^1.0.14",
"@paulober/pico-mpy-com": "^1.0.15",
"@vscode/python-extension": "^1.0.5",
"axios": "^1.7.5",
"fs-extra": "^11.2.0",
Expand Down
26 changes: 21 additions & 5 deletions src/activator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,31 @@ export default class Activator {
// [Command] Initialise
disposable = vscode.commands.registerCommand(
commandPrefix + "initialise",
async (pythonExecutable?: string, location?: string) => {
async (location?: string | vscode.Uri, pythonExecutable?: string) => {
// set python executable
if (pythonExecutable !== undefined && pythonExecutable.length > 0) {
await pythonApi.environments.updateActiveEnvironmentPath(
pythonExecutable
);
}
await this.stubs?.addToWorkspace(location);
if (this.ui?.isHidden() && !location) {

let isCurrentWorkspace = false;
if (
location &&
location instanceof vscode.Uri &&
workspaceFolder &&
workspaceFolder.length > 0
) {
const folder = workspaceFolder[0];
if (folder.uri.fsPath === location.fsPath) {
isCurrentWorkspace = true;
}
}
const path =
location instanceof vscode.Uri ? location.fsPath : location;

await this.stubs?.addToWorkspace(path);
if (this.ui?.isHidden() && (!path || isCurrentWorkspace)) {
await vscode.commands.executeCommand(commandPrefix + "connect");
this.ui?.show();
}
Expand Down Expand Up @@ -1338,10 +1354,10 @@ export default class Activator {
if (result.type === OperationResultType.commandResult) {
if (result.result) {
void vscode.window.showInformationMessage(
"Hard reset and reboot finished"
"Interactive Soft Reset finished"
);
} else {
void vscode.window.showErrorMessage("Hard reset failed");
void vscode.window.showErrorMessage("Soft reset failed");
}
}
this.terminal?.melt();
Expand Down

0 comments on commit defde8f

Please sign in to comment.