-
Notifications
You must be signed in to change notification settings - Fork 230
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.ps1 terminates on first request when started from Emacs (eglot) #2142
Comments
Hi there, sorry for the complicated setup, but what I believe is the problem is your argument to |
FWIW I'm trying to simplify this setup for you: #2129 but I need to get back to this PR. |
Thank you for your fast response. Your suggestion was correct: after changing
This is why I set up bundled modules path to
With such structure and setting |
Well...that's strange. I'll take a look. |
Well this encouraged me to get back to #2129; when we get this released would you test it out for us? |
Absolutely - just drop me a note here. |
@macmacy it's out if you want to give it a try! https://github.com/PowerShell/PowerShellEditorServices/releases/tag/v3.18.0 |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
Hm, I'm going to suggest redownloading to ensure the integrity of the bits, and check your system time? Did you download this exact asset https://github.com/PowerShell/PowerShellEditorServices/releases/download/v3.18.0/PowerShellEditorServices.zip? I just downloaded the release form GitHub and inspected the certificate, it looks correct and not revoked: |
Here's the SHA256 sum:
|
In short words: I can confirm it works now. With the following setup in .emacs:
I'm sorry for a headache with certificate.. This was my local problem. As for excuse, let me explain (partially) what was happening. I tried it on another system: no problems with signing certificate (yes, I know this is the first thing I should do...) Finally, I found this certificate in my Windows personal certificate store under "Untrusted Certificates" store! Being certified by Microsoft Root Certification Authority. It was one and only certificate there. I have no faintest idea HOW it got there... I did not put it there in any conscious way. What I googled out, is that this is Windows "blacklist" for certs and that it is Windows updates who writes this store. I also found some ancient article from 2012 about "Microsoft certification authority signing certificates added to the Untrusted Certificate Store": https://msrc.microsoft.com/blog/2012/06/microsoft-certification-authority-signing-certificates-added-to-the-untrusted-certificate-store/. So - such things happened. But nothing up to date. Anyway, after removing it from there - I got it working without any more complaints. Thanks once again for your support! |
Awesome! Just FYI with the simplification, I think you can just run this code now to setup (note the removal of most of the silly unnecessary arguments: (add-to-list
'eglot-server-programs
`(powershell-mode
. ("pwsh" "-NoLogo" "-NoProfile" "-Command" ,
"c:/bin/PowerShellEditorServices/PowerShellEditorServices/Start-EditorServices.ps1"
"-LogPath" ,"c:/users/mysername/AppData/Roaming/.pses-session/logs.log" "-LogLevel" "Diagnostic"
"-SessionDetailsPath" ,"c:/users/myusername/AppData/Roaming/.pses-session/session.json"
"-Stdio"))) Other than I'm unsure about which commas belong where... |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
This issue has been labeled as needing fix verification and has not had any activity a week. It has been closed for housekeeping purposes. |
Prerequisites
Summary
I use Emacs+eglot with other language servers: OmniSharp, pyright, clangd, but cannot make it work with PowerShellEditorServices. The services command starts but exists after a while. Last message in log is
Could not write to output handler, perhaps serialization failed?
.PowerShell Version
Editor Version
GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02
PowerShell Editor Services Version
3.17.0 (latest)
Steps to Reproduce
I have PSES configured in .emacs like that:
When I load .ps1 file, or execute
M-x eglot
when in powershell-mode, the Start-EditorServices is started but exists after a while, logging the following in session log file:I guess the server process exits on my first attempt to edit a file e.g. starting to type "Get-" or executing
M-x eglot-rename
Visuals
No response
Logs
log files from PSES session directory:
logs.log
StartEditorServices.log
The content of Emacs eglot events buffer:
eglotlog.txt
The text was updated successfully, but these errors were encountered: