-
I tried looking into adding proper command completion for powershell scripts and looks like https://github.com/PowerShell/PowerShellEditorServices is the way to go. Not sure on how to make this work out. Any steps on how to connect the services together would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hi @leimath After several hours I got the PowerShell services up and running. My languages.toml looks like this: [[language]]
name = "pwsh"
scope = "source.ps1"
roots = [".git"]
file-types = ["ps1"]
comment-token = "#"
indent = { tab-width = 2, unit = " " }
language-server = { command = "pwsh", args = ["-NoLogo", "-NoProfile", "-Command", "/usr/local/bin/powershell-es/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath /usr/local/bin/powershell-es -SessionDetailsPath /usr/local/bin/powershell-es/powershell_es.sessions.json -LogPath /usr/local/bin/powershell-es/powershell_es.log -FeatureFlags @() -AdditionalModules @() -HostName helix -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal"] } Now when I edit a script, it looks something like this: Hope this helps you |
Beta Was this translation helpful? Give feedback.
-
Is it possible to get syntax highlighting as well? I tried using this tree-sitter https://github.com/PowerShell/tree-sitter-PowerShell, but it didn't work. |
Beta Was this translation helpful? Give feedback.
-
No, unfortunately it is not possible currently as there is no working PowerShell treesitter. |
Beta Was this translation helpful? Give feedback.
-
it seems https://github.com/airbus-cert/tree-sitter-powershell works, tho i havent tried it |
Beta Was this translation helpful? Give feedback.
Hi @leimath
After several hours I got the PowerShell services up and running.
My setup is a MacBook Pro (Mac OS 12.6) with PowerShell 7.2.6 installed.
I downloaded the PowerShell editor services and extracted it under /usr/local/bin/powershell-es.
My languages.toml looks like this: