aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--installer/install-powershell-languageserver.cmd17
-rw-r--r--settings.json8
-rw-r--r--settings/powershell-languageserver.vim13
3 files changed, 38 insertions, 0 deletions
diff --git a/installer/install-powershell-languageserver.cmd b/installer/install-powershell-languageserver.cmd
new file mode 100644
index 0000000..a9e3cc0
--- /dev/null
+++ b/installer/install-powershell-languageserver.cmd
@@ -0,0 +1,17 @@
+@echo off
+
+curl -o PowerShellEditorServices.zip "https://github.com/PowerShell/PowerShellEditorServices/releases/download/2.0.0-preview.8/PowerShellEditorServices.zip"
+call "%~dp0\run_unzip.cmd" PowerShellEditorServices.zip
+del PowerShellEditorServices.zip
+
+echo @echo off ^
+
+setlocal ^
+
+set PSES_BUNDLE_PATH=%%~dp0PowerShellEditorServices ^
+
+set SESSION_TEMP_PATH=%%~dp0session ^
+
+powershell -NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command "%%PSES_BUNDLE_PATH:\=/%%/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath %%PSES_BUNDLE_PATH:\=/%% -LogPath %%SESSION_TEMP_PATH:\=/%%/logs.log -SessionDetailsPath %%SESSION_TEMP_PATH:\=/%%/session.json -FeatureFlags @() -AdditionalModules @() -HostName 'My Client' -HostProfileId 'myclient' -HostVersion 1.0.0 -Stdio -LogLevel Normal" ^
+
+> powershell-languageserver.cmd
diff --git a/settings.json b/settings.json
index d7bf7bd..a90989a 100644
--- a/settings.json
+++ b/settings.json
@@ -342,6 +342,14 @@
]
}
],
+ "ps1": [
+ {
+ "command": "powershell-languageserver",
+ "requires": [
+ "powershell"
+ ]
+ }
+ ],
"python": [
{
"command": "pyls",
diff --git a/settings/powershell-languageserver.vim b/settings/powershell-languageserver.vim
new file mode 100644
index 0000000..380a7ba
--- /dev/null
+++ b/settings/powershell-languageserver.vim
@@ -0,0 +1,13 @@
+augroup vimlsp_settings_powershell_languageserver
+ au!
+ LspRegisterServer {
+ \ 'name': 'powershell-languageserver',
+ \ 'cmd': {server_info->lsp_settings#get('powershell-languageserver', 'cmd', [lsp_settings#exec_path('powershell-languageserver')])},
+ \ 'root_uri':{server_info->lsp_settings#get('powershell-languageserver', 'root_uri', lsp_settings#root_uri(g:lsp_settings_root_markers))},
+ \ 'initialization_options': lsp_settings#get('powershell-languageserver', 'initialization_options', v:null),
+ \ 'whitelist': lsp_settings#get('powershell-languageserver', 'whitelist', ['ps1']),
+ \ 'blacklist': lsp_settings#get('powershell-languageserver', 'blacklist', []),
+ \ 'config': lsp_settings#get('powershell-languageserver', 'config', {}),
+ \ 'workspace_config': lsp_settings#get('powershell-languageserver', 'workspace_config', {}),
+ \ }
+augroup END