Skip to content

Commit b8189fc

Browse files
committed
Format all TypeScript using VS Code's formatter
Was mostly whitespace 🤷
1 parent 1cdb27c commit b8189fc

10 files changed

+38
-37
lines changed

src/features/DebugSession.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
// Licensed under the MIT License.
33

44
import vscode = require("vscode");
5-
import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
6-
ExtensionContext, WorkspaceFolder } from "vscode";
5+
import {
6+
CancellationToken, DebugConfiguration, DebugConfigurationProvider,
7+
ExtensionContext, WorkspaceFolder
8+
} from "vscode";
79
import { NotificationType, RequestType } from "vscode-languageclient";
810
import { LanguageClient } from "vscode-languageclient/node";
911
import { getPlatformDetails, OperatingSystem } from "../platform";
10-
import { PowerShellProcess} from "../process";
12+
import { PowerShellProcess } from "../process";
1113
import { IEditorServicesSessionDetails, SessionManager, SessionStatus } from "../session";
1214
import Settings = require("../settings");
1315
import { Logger } from "../logging";
@@ -358,7 +360,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
358360
this.command =
359361
vscode.commands.registerCommand("PowerShell.PickPSHostProcess", () => {
360362
return this.getLanguageClient()
361-
.then((_) => this.pickPSHostProcess(), (_) => undefined);
363+
.then((_) => this.pickPSHostProcess(), (_) => undefined);
362364
});
363365
}
364366

@@ -480,7 +482,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
480482
this.command =
481483
vscode.commands.registerCommand("PowerShell.PickRunspace", (processId) => {
482484
return this.getLanguageClient()
483-
.then((_) => this.pickRunspace(processId), (_) => undefined);
485+
.then((_) => this.pickRunspace(processId), (_) => undefined);
484486
}, this);
485487
}
486488

src/features/FindModule.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export class FindModuleFeature extends LanguageClientConsumer {
2424
this.cancelFindToken = new vscode.CancellationTokenSource();
2525
vscode.window
2626
.showQuickPick(
27-
["Cancel"],
28-
{ placeHolder: "Please wait, retrieving list of PowerShell modules. This can take some time..." },
29-
this.cancelFindToken.token)
27+
["Cancel"],
28+
{ placeHolder: "Please wait, retrieving list of PowerShell modules. This can take some time..." },
29+
this.cancelFindToken.token)
3030
.then((response) => {
3131
if (response === "Cancel") { this.clearCancelFindToken(); }
3232
});

src/features/GetCommands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class GetCommandsFeature extends LanguageClientConsumer {
3939
{ treeDataProvider: this.commandsExplorerProvider });
4040

4141
// Refresh the command explorer when the view is visible
42-
this.commandsExplorerTreeView.onDidChangeVisibility( (e) => {
42+
this.commandsExplorerTreeView.onDidChangeVisibility((e) => {
4343
if (e.visible) {
4444
this.CommandExplorerRefresh();
4545
}

src/features/HelpCompletion.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import { Disposable, EndOfLine, Range, SnippetString,
5-
TextDocument, TextDocumentChangeEvent, window, workspace } from "vscode";
4+
import {
5+
Disposable, EndOfLine, Range, SnippetString,
6+
TextDocument, TextDocumentChangeEvent, window, workspace
7+
} from "vscode";
68
import { RequestType } from "vscode-languageclient";
79
import { LanguageClient } from "vscode-languageclient/node";
810
import { Logger } from "../logging";
@@ -95,8 +97,8 @@ class TriggerFinder {
9597

9698
case SearchState.Locked:
9799
if (document === this.document &&
98-
changeText.length === 1 &&
99-
changeText[0] === this.triggerCharacters[this.count]) {
100+
changeText.length === 1 &&
101+
changeText[0] === this.triggerCharacters[this.count]) {
100102
this.count++;
101103
if (this.count === this.triggerCharacters.length) {
102104
this.state = SearchState.Found;

src/features/NewFileOrProject.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export class NewFileOrProjectFeature extends LanguageClientConsumer {
3535

3636
// Cancel the loading prompt after 60 seconds
3737
setTimeout(() => {
38-
if (this.waitingForClientToken) {
39-
this.clearWaitingToken();
38+
if (this.waitingForClientToken) {
39+
this.clearWaitingToken();
4040

41-
vscode.window.showErrorMessage(
42-
"New Project: PowerShell session took too long to start.");
43-
}
44-
}, 60000);
41+
vscode.window.showErrorMessage(
42+
"New Project: PowerShell session took too long to start.");
43+
}
44+
}, 60000);
4545
} else {
4646
this.showProjectTemplates();
4747
}

src/features/ShowHelp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class ShowHelpFeature extends LanguageClientConsumer {
2828

2929
this.languageClient?.sendNotification(ShowHelpNotificationType, { text });
3030
} else {
31-
this.languageClient?.sendNotification(ShowHelpNotificationType, { text: item.Name } );
31+
this.languageClient?.sendNotification(ShowHelpNotificationType, { text: item.Name });
3232
}
3333
});
3434
}

src/features/UpdatePowerShell.ts

+10-13
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { EvaluateRequestType } from "./Console";
2020
const streamPipeline = util.promisify(stream.pipeline);
2121

2222
const PowerShellGitHubReleasesUrl =
23-
"https://api.github.com/repos/PowerShell/PowerShell/releases/latest";
23+
"https://api.github.com/repos/PowerShell/PowerShell/releases/latest";
2424
const PowerShellGitHubPrereleasesUrl =
2525
"https://api.github.com/repos/PowerShell/PowerShell/releases";
2626

@@ -102,11 +102,9 @@ export async function InvokePowerShellUpdateCheck(
102102
return;
103103
}
104104

105-
const commonText: string = `You have an old version of PowerShell (${
106-
localVersion.raw
107-
}). The current latest release is ${
108-
release.version.raw
109-
}.`;
105+
const commonText: string = `You have an old version of PowerShell (${localVersion.raw
106+
}). The current latest release is ${release.version.raw
107+
}.`;
110108

111109
if (process.platform === "linux") {
112110
await window.showInformationMessage(
@@ -115,9 +113,8 @@ export async function InvokePowerShellUpdateCheck(
115113
}
116114

117115
const result = await window.showInformationMessage(
118-
`${commonText} Would you like to update the version? ${
119-
isMacOS ? "(Homebrew is required on macOS)"
120-
: "(This will close ALL pwsh terminals running in this Visual Studio Code session)"
116+
`${commonText} Would you like to update the version? ${isMacOS ? "(Homebrew is required on macOS)"
117+
: "(This will close ALL pwsh terminals running in this Visual Studio Code session)"
121118
}`, ...options);
122119

123120
// If the user cancels the notification.
@@ -144,10 +141,10 @@ export async function InvokePowerShellUpdateCheck(
144141
location: ProgressLocation.Notification,
145142
cancellable: false,
146143
},
147-
async () => {
148-
// Streams the body of the request to a file.
149-
await streamPipeline(res.body, fs.createWriteStream(msiDownloadPath));
150-
});
144+
async () => {
145+
// Streams the body of the request to a file.
146+
await streamPipeline(res.body, fs.createWriteStream(msiDownloadPath));
147+
});
151148

152149
// Stop the session because Windows likes to hold on to files.
153150
sessionManager.stop();

src/process.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class PowerShellProcess {
5252

5353
this.startPsesArgs +=
5454
`-LogPath '${PowerShellProcess.escapeSingleQuotes(editorServicesLogPath.fsPath)}' ` +
55-
`-SessionDetailsPath '${PowerShellProcess.escapeSingleQuotes(this.sessionFilePath.fsPath)}' ` +
55+
`-SessionDetailsPath '${PowerShellProcess.escapeSingleQuotes(this.sessionFilePath.fsPath)}' ` +
5656
`-FeatureFlags @(${featureFlags}) `;
5757

5858
if (this.sessionSettings.integratedConsole.useLegacyReadLine) {

src/session.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ Type 'help' to get help.
838838
case SessionStatus.Stopping:
839839
if (this.PowerShellExeDetails && this.versionDetails) {
840840
const currentPowerShellExe =
841-
availablePowerShellExes
842-
.find((item) => item.displayName.toLowerCase() === this.PowerShellExeDetails!.displayName.toLowerCase());
841+
availablePowerShellExes
842+
.find((item) => item.displayName.toLowerCase() === this.PowerShellExeDetails!.displayName.toLowerCase());
843843

844844
const powerShellSessionName =
845845
currentPowerShellExe ?

src/settings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export async function getEffectiveConfigurationTarget(settingName: string): Prom
286286
const detail = configuration.inspect(settingName);
287287
if (detail === undefined) {
288288
return undefined;
289-
} else if ( typeof detail.workspaceFolderValue !== "undefined") {
289+
} else if (typeof detail.workspaceFolderValue !== "undefined") {
290290
return vscode.ConfigurationTarget.WorkspaceFolder;
291291
}
292292
else if (typeof detail.workspaceValue !== "undefined") {

0 commit comments

Comments
 (0)