Skip to content

Commit b64a1c2

Browse files
author
Tim Etchells
committed
small fixes
- fix open folder on connection - only activate codewind if necessary - show error message from failed installer start ccmd
1 parent c5f854a commit b64a1c2

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

dev/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
],
8888

8989
"isInViewWithNothingSelected": "view == ext.cw.explorer && !viewItem",
90-
"isConnection": "viewItem =~ /ext\\.cw.\\.connection\\.(connected|disconnected)/",
90+
"isConnection": "viewItem =~ /ext\\.cw\\.connection\\.(connected|disconnected)/",
9191
"isActiveConnection": "viewItem == ext.cw.connection.connected",
9292
"isInactiveConnection": "viewItem == ext.cw.connection.disconnected",
9393
"isConnectingConnection": "viewItem == ext.cw.connection.connecting",

dev/src/command/ActivateConnectionCmd.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,17 @@ async function tryAddConnection(connInfo: MCUtil.IConnectionInfo): Promise<Conne
8080

8181
let envData: MCEnvironment.IMCEnvData;
8282
try {
83-
await InstallerWrapper.start();
84-
envData = await MCEnvironment.getEnvData(url);
83+
try {
84+
envData = await MCEnvironment.getEnvData(url);
85+
}
86+
catch (err) {
87+
await InstallerWrapper.start();
88+
envData = await MCEnvironment.getEnvData(url);
89+
}
8590
}
8691
catch (err) {
8792
Log.e("Failed to contact codewind", err);
88-
vscode.window.showErrorMessage("Failed to start Codewind. You can try starting it manually using the installer.");
93+
vscode.window.showErrorMessage("Failed to start Codewind: " + MCUtil.errToString(err));
8994
return undefined;
9095
}
9196

dev/src/view/ProjectTree.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export default class ProjectTreeDataProvider implements vscode.TreeDataProvider<
3434
ConnectionManager.instance.addOnChangeListener(this.refresh);
3535
Log.d("Finished constructing ProjectTree");
3636

37-
this.treeView.onDidChangeSelection((e) => {
38-
Log.d("Selection is now", e.selection[0]);
39-
});
37+
// this.treeView.onDidChangeSelection((e) => {
38+
// Log.d("Selection is now", e.selection[0]);
39+
// });
4040
}
4141

4242
/**

dev/src/view/TreeItemFactory.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ function getConnectionContext(connection: Connection): string {
159159
else {
160160
contextValue = TreeContextValues.CONN_DISCONNECTED;
161161
}
162-
return buildContextValue([contextValue]);
162+
const cv = buildContextValue([contextValue]);
163+
// Log.d(`The context value for ${connection} is ${cv}`);
164+
return cv;
163165
}
164166

165167
function getProjectContext(project: Project): string {

0 commit comments

Comments
 (0)