Skip to content

Commit

Permalink
lsp-pwsh: add supports for powershell-ts-mode (#4408)
Browse files Browse the repository at this point in the history
* lsp-pwsh: add supports for powershell-ts-mode

* update
  • Loading branch information
kiennq authored Apr 1, 2024
1 parent e7c332a commit b75777a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions clients/lsp-pwsh.el
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,12 @@ Must not nil.")
rule-id))
(lsp-warn "Cannot show documentation for code action, no ruleName was supplied")))

(defvar lsp-pwsh--major-modes '(powershell-mode))

(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection #'lsp-pwsh--command
(lambda ()
(f-exists? lsp-pwsh-pses-script)))
:major-modes lsp-pwsh--major-modes
:activation-fn (lsp-activate-on "powershell")
:server-id 'pwsh-ls
:priority -1
:initialization-options #'lsp-pwsh--extra-init-params
Expand Down
9 changes: 6 additions & 3 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -764,26 +764,27 @@ Changes take effect only when a new session is started."
("\\.astro$" . "astro")
("\\.cs\\'" . "csharp")
("\\.css$" . "css")
("\\.cypher$" . "cypher")
("\\.ebuild$" . "shellscript")
("\\.go\\'" . "go")
("\\.html$" . "html")
("\\.hx$" . "haxe")
("\\.hy$" . "hy")
("\\.java\\'" . "java")
("\\.jq$" . "jq")
("\\.js$" . "javascript")
("\\.json$" . "json")
("\\.jsonnet$" . "jsonnet")
("\\.jsonc$" . "jsonc")
("\\.jsonnet$" . "jsonnet")
("\\.jsx$" . "javascriptreact")
("\\.jq$" . "jq")
("\\.lua$" . "lua")
("\\.mdx\\'" . "mdx")
("\\.nu$" . "nushell")
("\\.php$" . "php")
("\\.ps[dm]?1\\'" . "powershell")
("\\.rs\\'" . "rust")
("\\.spec\\'" . "rpm-spec")
("\\.sql$" . "sql")
("\\.cypher$" . "cypher")
("\\.svelte$" . "svelte")
("\\.toml\\'" . "toml")
("\\.ts$" . "typescript")
Expand Down Expand Up @@ -866,6 +867,7 @@ Changes take effect only when a new session is started."
(php-ts-mode . "php")
(powershell-mode . "powershell")
(powershell-mode . "PowerShell")
(powershell-ts-mode . "powershell")
(json-mode . "json")
(json-ts-mode . "json")
(jsonc-mode . "jsonc")
Expand Down Expand Up @@ -6021,6 +6023,7 @@ Request codeAction/resolve for more info if server supports."
(php-mode . c-basic-offset) ; PHP
(php-ts-mode . php-ts-mode-indent-offset) ; PHP
(powershell-mode . powershell-indent) ; PowerShell
(powershell-ts-mode . powershell-ts-mode-indent-offset) ; PowerShell
(raku-mode . raku-indent-offset) ; Perl6/Raku
(ruby-mode . ruby-indent-level) ; Ruby
(rust-mode . rust-indent-offset) ; Rust
Expand Down

0 comments on commit b75777a

Please sign in to comment.