Skip to content

powershell_es

https://github.com/PowerShell/PowerShellEditorServices

Language server for PowerShell.

To install, download and extract PowerShellEditorServices.zip from the releases. To configure the language server, set the property bundle_path to the root of the extracted PowerShellEditorServices.zip.

The default configuration doesn't set cmd unless bundle_path is specified.

require'lspconfig'.powershell_es.setup{
  bundle_path = 'c:/w/PowerShellEditorServices',
}

If necessary, specific cmd can be defined instead of bundle_path. See PowerShellEditorServices to learn more.

require'lspconfig'.powershell_es.setup{
  cmd = {'pwsh', '-NoLogo', '-NoProfile', '-Command', "c:/PSES/Start-EditorServices.ps1 ..."}
}

Setup

require'lspconfig'.powershell_es.setup{}

Default values

filetypes = { "ps1" }
on_new_config = function(new_config, _)
      local bundle_path = new_config.bundle_path
      new_config.cmd = make_cmd(bundle_path)
    end,
root_dir = function(fname)
      return util.find_git_ancestor(fname) or vim.fn.getcwd()
    end,
Back to top