pwsh-ls error on emacs (with fix)
@andyleejordan arbeitet bereits daran.
Seit 28.7.2021.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
I noticed an error when trying to use pwsh-ls with emacs for editing powershell scripts.
I get this error on the pwsh-ls::stderr buffer:

Process pwsh-ls stderr finished
The argument 'c:/Users/Ryan/AppData/Roaming/.emacs.d/.cache/lsp/pwsh/PowerShellEditorServices/PowerShellEditorServices/Start-EditorServices.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.
It looked strange that the directory argument after /pwsh/ is /PowerShellEditorServices/PowerShellEditorServices/ and this is where the issue is, as there is not actually another directory named "PowerShellEditorServices" inside the first when I check my own folder as installed from the language server, as shown in this image below.

I am not entirely sure if this is just a one off issue or something wrong with my install, but I freshly installed windows today and emacs, so I may assume it could be persistent issue, clearly if it is then the solution is to change the argument applied to not have two subdirectories of /PowerShellEditorServices/ because clearly it doesn't exist.
The steps to reproduce this is to;
- install the lsp-mode package
- open a .ps1 powershell script file, emacs will prompt to install the pwsh-ls language server
- pwsh-ls::stderr reports error message provided at start of this issue
Steps to fix: (until this is patched if it's a persistent isssue)
-
Create another folder in "C:\Users\USER\AppData\Roaming.emacs.d.cache\lsp\pwsh\PowerShellEditorServices" with the name PowerShellEditorServices
-
Copy every thing into the deeper directory so it looks like this:

-
Restart emacs and the language server should be somewhat working..

If you are getting errors like below in your lsp-log buffer then you need to install PSScriptAnalyzer at https://github.com/PowerShell/PSScriptAnalyzer after that everything should be working smoothly!

- Vorherrschende Sprache
- C#
- Sterne
- 767
- Forks
- 266
- Ø Merge
- 3 T. 16 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET.Evtl. wieder frei @andyleejordan hat das vor 95 Tagen übernommen, und es ist kein Pull Request offen. Offen
PowerShell/PowerShellEditorServices#2331 · 1 Reaktion · 2 zugewiesene Personen ·
-
Area-Language Server Issue-Enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
PowerShell/PowerShellEditorServices#2315 · 1 Kommentar ·
-
Improve Constrained Runspace Debug ExperienceEvtl. vergeben @JustinGrote hat das vor 119 Tagen übernommen. OffenArea-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 Reaktion · 2 zugewiesene Personen ·
-
Issue-Bug Needs: Triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
PowerShell/PowerShellEditorServices#2293 · 1 Kommentar ·
-
Document outline drops child variables when a function/filter reuses a variable name declared earlier (scope-blind declaration dedup)Evtl. vergeben @JustinGrote hat das vor 146 Tagen übernommen. Offen
PowerShell/PowerShellEditorServices#2282 · 1 Kommentar · 1 Reaktion · 2 zugewiesene Personen ·
Alle Issues in PowerShell/PowerShellEditorServices
Ähnliche Issues
-
WPF: each page's `Title` overwrites the window title, and returning to a page does not restore itOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
agentic-workflows area/Docs partner/agentic-workflows
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
jamesmontemagno/tiny-clips#378 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
go 🏃 testing 🧪
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
valkey-io/valkey-glide#7239 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
SubtitleEdit/subtitleedit#15462 ·
Maintainer antworten meist innerhalb von 1 Tag