pwsh-ls error on emacs (with fix)
@andyleejordan y travaille déjà.
Depuis le 28/7/2021.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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!

- Langage dominant
- C#
- Étoiles
- 772
- Forks
- 268
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET.Peut-être à nouveau libre @andyleejordan l’a pris il y a 101 jours, et aucune pull request n’est ouverte. Ouverte
PowerShell/PowerShellEditorServices#2331 · 1 réaction · 2 personnes assignées ·
-
Area-Language Server Issue-Enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
PowerShell/PowerShellEditorServices#2315 · 1 commentaire ·
-
Improve Constrained Runspace Debug ExperiencePeut-être pris @JustinGrote l’a pris il y a 124 jours. OuverteArea-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 réaction · 2 personnes assignées ·
-
Issue-Bug Needs: Triage
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
PowerShell/PowerShellEditorServices#2293 · 1 commentaire ·
-
Document outline drops child variables when a function/filter reuses a variable name declared earlier (scope-blind declaration dedup)Peut-être pris @JustinGrote l’a pris il y a 152 jours. Ouverte
PowerShell/PowerShellEditorServices#2282 · 1 commentaire · 1 réaction · 2 personnes assignées ·
Toutes les issues de PowerShell/PowerShellEditorServices
Issues similaires
-
test
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NethermindEth/nethermind#14274 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
area:frontend bug FE P3
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
klasolsson81/jobbliggaren#2023 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
shimat/opencvsharp#2154 ·
Les mainteneurs répondent en général sous 1 jour
-
subsystem: UI
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Open-Systems-Pharmacology/PK-Sim#3812 ·
Les mainteneurs répondent en général sous 1 jour