Skip to content

Commit

Permalink
Clean up extra newlines in vscode-powershell logs
Browse files Browse the repository at this point in the history
  • Loading branch information
daviwil committed Sep 13, 2017
1 parent 4260b19 commit 2c6e76f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
18 changes: 7 additions & 11 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ export class PowerShellProcess {
powerShellExePath = batScriptPath;
}

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

// Make sure no old session file exists
utils.deleteSessionFile(this.sessionFilePath);
Expand Down Expand Up @@ -134,20 +137,13 @@ export class PowerShellProcess {
vscode.window.onDidCloseTerminal(
terminal => {
if (terminal === this.consoleTerminal) {
this.log.write(os.EOL + "powershell.exe terminated or terminal UI was closed" + os.EOL);
this.log.write("powershell.exe terminated or terminal UI was closed");
this.onExitedEmitter.fire();
}
});

this.consoleTerminal.processId.then(
pid => {
console.log("powershell.exe started, pid: " + pid + ", exe: " + powerShellExePath);
this.log.write(
"powershell.exe started --",
" pid: " + pid,
" exe: " + powerShellExePath,
" args: " + startScriptPath + ' ' + this.startArgs + os.EOL + os.EOL);
});
pid => { this.log.write(`powershell.exe started, pid: ${pid}`); });
}
catch (e)
{
Expand All @@ -173,7 +169,7 @@ export class PowerShellProcess {
}

if (this.consoleTerminal) {
this.log.write(os.EOL + "Terminating PowerShell process...");
this.log.write("Terminating PowerShell process...");
this.consoleTerminal.dispose();
this.consoleTerminal = undefined;
}
Expand Down
6 changes: 3 additions & 3 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class SessionManager implements Middleware {
this.log.write(
`Visual Studio Code v${vscode.version} ${procBitness}`,
`PowerShell Extension v${this.hostVersion}`,
`Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}\n`);
`Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}`);

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

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

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

try
{
this.log.write("Connecting to language service on port " + port + "..." + os.EOL);
this.log.write("Connecting to language service on port " + port + "...");

let connectFunc = () => {
return new Promise<StreamInfo>(
Expand Down

0 comments on commit 2c6e76f

Please sign in to comment.