Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start EditorServices without start script #2348

Merged
merged 3 commits into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export class PowerShellProcess {
return new Promise<utils.IEditorServicesSessionDetails>(
(resolve, reject) => {
try {
const startScriptPath =
const psesModulePath =
path.resolve(
__dirname,
this.bundledModulesPath,
"PowerShellEditorServices/Start-EditorServices.ps1");
"PowerShellEditorServices/PowerShellEditorServices.psd1");

const editorServicesLogPath = this.log.getLogFilePath(logFileName);

Expand Down Expand Up @@ -73,9 +73,9 @@ export class PowerShellProcess {
powerShellArgs.push("-ExecutionPolicy", "Bypass");
}

const startEditorServices = "& '" +
PowerShellProcess.escapeSingleQuotes(startScriptPath) +
"' " + this.startArgs;
const startEditorServices = "Import-Module '" +
PowerShellProcess.escapeSingleQuotes(psesModulePath) +
"'; Start-EditorServices " + this.startArgs;

if (utils.isWindows) {
powerShellArgs.push(
Expand Down Expand Up @@ -108,7 +108,7 @@ export class PowerShellProcess {
this.log.write(
"Language server starting --",
" exe: " + powerShellExePath,
" args: " + startScriptPath + " " + this.startArgs);
" args: " + startEditorServices);

// Make sure no old session file exists
utils.deleteSessionFile(this.sessionFilePath);
Expand Down