Skip to content

Commit b75777a

Browse files
authored
lsp-pwsh: add supports for powershell-ts-mode (#4408)
* lsp-pwsh: add supports for powershell-ts-mode * update
1 parent e7c332a commit b75777a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

clients/lsp-pwsh.el

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,12 @@ Must not nil.")
293293
rule-id))
294294
(lsp-warn "Cannot show documentation for code action, no ruleName was supplied")))
295295

296-
(defvar lsp-pwsh--major-modes '(powershell-mode))
297-
298296
(lsp-register-client
299297
(make-lsp-client
300298
:new-connection (lsp-stdio-connection #'lsp-pwsh--command
301299
(lambda ()
302300
(f-exists? lsp-pwsh-pses-script)))
303-
:major-modes lsp-pwsh--major-modes
301+
:activation-fn (lsp-activate-on "powershell")
304302
:server-id 'pwsh-ls
305303
:priority -1
306304
:initialization-options #'lsp-pwsh--extra-init-params

lsp-mode.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,26 +764,27 @@ Changes take effect only when a new session is started."
764764
("\\.astro$" . "astro")
765765
("\\.cs\\'" . "csharp")
766766
("\\.css$" . "css")
767+
("\\.cypher$" . "cypher")
767768
("\\.ebuild$" . "shellscript")
768769
("\\.go\\'" . "go")
769770
("\\.html$" . "html")
770771
("\\.hx$" . "haxe")
771772
("\\.hy$" . "hy")
772773
("\\.java\\'" . "java")
774+
("\\.jq$" . "jq")
773775
("\\.js$" . "javascript")
774776
("\\.json$" . "json")
775-
("\\.jsonnet$" . "jsonnet")
776777
("\\.jsonc$" . "jsonc")
778+
("\\.jsonnet$" . "jsonnet")
777779
("\\.jsx$" . "javascriptreact")
778-
("\\.jq$" . "jq")
779780
("\\.lua$" . "lua")
780781
("\\.mdx\\'" . "mdx")
781782
("\\.nu$" . "nushell")
782783
("\\.php$" . "php")
784+
("\\.ps[dm]?1\\'" . "powershell")
783785
("\\.rs\\'" . "rust")
784786
("\\.spec\\'" . "rpm-spec")
785787
("\\.sql$" . "sql")
786-
("\\.cypher$" . "cypher")
787788
("\\.svelte$" . "svelte")
788789
("\\.toml\\'" . "toml")
789790
("\\.ts$" . "typescript")
@@ -866,6 +867,7 @@ Changes take effect only when a new session is started."
866867
(php-ts-mode . "php")
867868
(powershell-mode . "powershell")
868869
(powershell-mode . "PowerShell")
870+
(powershell-ts-mode . "powershell")
869871
(json-mode . "json")
870872
(json-ts-mode . "json")
871873
(jsonc-mode . "jsonc")
@@ -6021,6 +6023,7 @@ Request codeAction/resolve for more info if server supports."
60216023
(php-mode . c-basic-offset) ; PHP
60226024
(php-ts-mode . php-ts-mode-indent-offset) ; PHP
60236025
(powershell-mode . powershell-indent) ; PowerShell
6026+
(powershell-ts-mode . powershell-ts-mode-indent-offset) ; PowerShell
60246027
(raku-mode . raku-indent-offset) ; Perl6/Raku
60256028
(ruby-mode . ruby-indent-level) ; Ruby
60266029
(rust-mode . rust-indent-offset) ; Rust

0 commit comments

Comments
 (0)