Skip to content

Commit d76f2e2

Browse files
authored
Discover new PowerShell installations, fix startup issue with Windows PowerShell (#2238)
* Fix original startup issue * Create PowerShell searcher class for reuse * Find MSIX/Store and dotnet global tool installations * Disable .NET global tool discovery until its ready * Change startup order to present most relevant first * Refactor tests to make it easier to test multiple configurations * Offer PowerShell installation link when no PowerShell is found
1 parent fb0551f commit d76f2e2

File tree

7 files changed

+1317
-403
lines changed

7 files changed

+1317
-403
lines changed

.vscode/launch.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
"stopOnEntry": false,
3333
"sourceMaps": true,
3434
"outFiles": ["${workspaceRoot}/out/test/**/*.js"],
35-
"preLaunchTask": "Build"
35+
"preLaunchTask": "Build",
36+
"skipFiles": [
37+
"${workspaceFolder}/node_modules/**/*",
38+
"${workspaceFolder}/lib/**/*",
39+
"/private/var/folders/**/*",
40+
"<node_internals>/**/*"
41+
]
3642
},
3743
{
3844
"name": "Attach",

package-lock.json

+145
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,18 @@
4848
},
4949
"devDependencies": {
5050
"@types/mocha": "~5.2.7",
51+
"@types/mock-fs": "~4.10.0",
5152
"@types/node": "~10.11.0",
52-
"@types/node-fetch": "^2.5.2",
53-
"@types/rewire": "^2.5.28",
54-
"@types/semver": "^6.2.0",
53+
"@types/node-fetch": "~2.5.2",
54+
"@types/rewire": "~2.5.28",
55+
"@types/semver": "~6.0.2",
56+
"@types/sinon": "~7.5.0",
5557
"mocha": "~5.2.0",
5658
"mocha-junit-reporter": "~1.23.1",
5759
"mocha-multi-reporters": "~1.1.7",
60+
"mock-fs": "~4.10.2",
5861
"rewire": "~4.0.1",
62+
"sinon": "~7.5.0",
5963
"tslint": "~5.20.0",
6064
"typescript": "~3.5.3",
6165
"vsce": "~1.68.0",

src/logging.ts

+23
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,29 @@ export class Logger implements ILogger {
114114
});
115115
}
116116

117+
public async writeAndShowErrorWithActions(
118+
message: string,
119+
actions: Array<{ prompt: string; action: () => Promise<void> }>) {
120+
this.writeError(message);
121+
122+
const fullActions = [
123+
...actions,
124+
{ prompt: "Show Logs", action: async () => { this.showLogPanel(); } },
125+
];
126+
127+
const actionKeys: string[] = fullActions.map((action) => action.prompt);
128+
129+
const choice = await vscode.window.showErrorMessage(message, ...actionKeys);
130+
if (choice) {
131+
for (const action of fullActions) {
132+
if (choice === action.prompt) {
133+
await action.action();
134+
return;
135+
}
136+
}
137+
}
138+
}
139+
117140
public startNewLog(minimumLogLevel: string = "Normal") {
118141
this.MinimumLogLevel = this.logLevelNameToValue(minimumLogLevel.trim());
119142

0 commit comments

Comments
 (0)