Skip to content

Integrating PSES into Visual Studio #1643

@Xrumet

Description

@Xrumet

Hi,
Not sure is an issue or I doing something wrong...
I am trying to kickoff POC project to integrate PSES into Visual Studio.
Before starting to work on extension itself I would like to check how to deal with PSES in a simple console application (with some hardcoded settings).

First step is to start Server - is done. I guess it is done, at least I see running process, log.txt, StartEditorServices.log and sessionDetails.json files with proper data inside.

Second step is to create and initialize Client - and here is an issue...
I have find out that PSES itself using OmniShart under the hood to startup Server so I decided to go same way by using "OmniSharp.Extensions.LanguageServer.Client" and "var PsesLanguageClient = LanguageClient.Create(options => ..." to get an instance of Client.
I have stuck on "await PsesLanguageClient.Initialize(new CancellationToken()).ConfigureAwait(false);".
Playing with that in a different ways - I guess the issue is, request is sent but no response because of "Access deny" issue in internal "System.IO" implementation for named pipes.

Environment details:

  • OS Windows 10 Enterprise, Version 21H1, Build 19043.1165
  • Net Framework runtime 4.7.1
  • PowerShell Version 5.1.19041.1151
  • LSP Transport is duplex named pipe

startup.ps1 file looks like that:

$PSES_BUNDLE_PATH = "D:\PowerShellEditorServices"
$SESSION_TEMP_PATH  = "D:\pslog"

. $PSES_BUNDLE_PATH/PowerShellEditorServices/Start-EditorServices.ps1 `
	-BundledModulesPath $PSES_BUNDLE_PATH `
	-LogPath "$SESSION_TEMP_PATH/logs.log" `
	-SessionDetailsPath "$SESSION_TEMP_PATH/session.json" `
	-FeatureFlags @() `
	-AdditionalModules @() `
	-HostName 'My Client' `
	-HostProfileId 'myclient' `
	-HostVersion 1.0.0 `
	-LogLevel Verbose

Maybe you have or may provide simple sample? I have found some based on NodeJs but nothing for C#.
And maybe my main question is - do you officially support to work on Windows with combination of PS v5 and Net 4.7.1?

Please let me know if I may provide any additional information, and thanks a lot for any help...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions