Skip to content

Prepare to work with newer PSES versions #156

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

Merged
merged 2 commits into from
Oct 4, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ open class EditorServicesLanguageHostStarter(protected val myProject: Project) :
val writePipeName = sessionInfo.languageServiceWritePipeName
return if (SystemInfo.isWindows) {
val readPipe = RandomAccessFile(readPipeName, "rwd")
val writePipe = RandomAccessFile(writePipeName, "rwd")
val writePipe = RandomAccessFile(writePipeName, "r")
val serverReadChannel = readPipe.channel
val serverWriteChannel = writePipe.channel
val inSf = Channels.newInputStream(serverWriteChannel)
Expand Down Expand Up @@ -240,6 +240,14 @@ open class EditorServicesLanguageHostStarter(protected val myProject: Project) :
cachedEditorServicesModuleVersion = null
val commandLine = buildCommandLine()
val process = createProcess(myProject, commandLine, null)
val pid: Long = getProcessID(process)
processOutput(
process,
pid,
ParametersListUtil.join(commandLine),
getEditorServicesVersion(getPowerShellEditorServicesHome())
)

val fileWithSessionInfo = getSessionDetailsFile()
//todo retry starting language service process one more time
if (!waitForSessionFile(fileWithSessionInfo)) {
Expand All @@ -253,13 +261,6 @@ open class EditorServicesLanguageHostStarter(protected val myProject: Project) :
return null
}

val pid: Long = getProcessID(process)
processOutput(
process,
pid,
ParametersListUtil.join(commandLine),
getEditorServicesVersion(getPowerShellEditorServicesHome())
)
myProcess = process

var msg = "PowerShell language host process started, $sessionInfo"
Expand Down