Skip to content

Commit 9097e9d

Browse files
committed
Clean up extra newlines in vscode-powershell logs
1 parent e60888a commit 9097e9d

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/process.ts

+7-11
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export class PowerShellProcess {
8585
powerShellExePath = batScriptPath;
8686
}
8787

88-
this.log.write("Language server starting...");
88+
this.log.write(
89+
"Language server starting --",
90+
" exe: " + powerShellExePath,
91+
" args: " + startScriptPath + ' ' + this.startArgs);
8992

9093
// Make sure no old session file exists
9194
utils.deleteSessionFile(this.sessionFilePath);
@@ -134,20 +137,13 @@ export class PowerShellProcess {
134137
vscode.window.onDidCloseTerminal(
135138
terminal => {
136139
if (terminal === this.consoleTerminal) {
137-
this.log.write(os.EOL + "powershell.exe terminated or terminal UI was closed" + os.EOL);
140+
this.log.write("powershell.exe terminated or terminal UI was closed");
138141
this.onExitedEmitter.fire();
139142
}
140143
});
141144

142145
this.consoleTerminal.processId.then(
143-
pid => {
144-
console.log("powershell.exe started, pid: " + pid + ", exe: " + powerShellExePath);
145-
this.log.write(
146-
"powershell.exe started --",
147-
" pid: " + pid,
148-
" exe: " + powerShellExePath,
149-
" args: " + startScriptPath + ' ' + this.startArgs + os.EOL + os.EOL);
150-
});
146+
pid => { this.log.write(`powershell.exe started, pid: ${pid}`); });
151147
}
152148
catch (e)
153149
{
@@ -173,7 +169,7 @@ export class PowerShellProcess {
173169
}
174170

175171
if (this.consoleTerminal) {
176-
this.log.write(os.EOL + "Terminating PowerShell process...");
172+
this.log.write("Terminating PowerShell process...");
177173
this.consoleTerminal.dispose();
178174
this.consoleTerminal = undefined;
179175
}

src/session.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class SessionManager implements Middleware {
8383
this.log.write(
8484
`Visual Studio Code v${vscode.version} ${procBitness}`,
8585
`PowerShell Extension v${this.hostVersion}`,
86-
`Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}\n`);
86+
`Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}`);
8787

8888
// Fix the host version so that PowerShell can consume it.
8989
// This is needed when the extension uses a prerelease
@@ -185,7 +185,7 @@ export class SessionManager implements Middleware {
185185
public stop() {
186186

187187
// Shut down existing session if there is one
188-
this.log.write(os.EOL + os.EOL + "Shutting down language client...");
188+
this.log.write("Shutting down language client...");
189189

190190
if (this.sessionStatus === SessionStatus.Failed) {
191191
// Before moving further, clear out the client and process if
@@ -374,7 +374,7 @@ export class SessionManager implements Middleware {
374374

375375
try
376376
{
377-
this.log.write("Connecting to language service on port " + port + "..." + os.EOL);
377+
this.log.write("Connecting to language service on port " + port + "...");
378378

379379
let connectFunc = () => {
380380
return new Promise<StreamInfo>(

0 commit comments

Comments
 (0)