Skip to content

Commit 0cad32f

Browse files
committed
Fix server commadn
1 parent df688b8 commit 0cad32f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lsp-shader.el

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,28 @@ Will update if UPDATE? is t"
6060
error-callback
6161
"dotnet" "tool" (if update? "update" "install") "-g" "shader-ls"))
6262

63+
(defun lsp-shader--cls-test-shader-ls-present ()
64+
"Return non-nil if dotnet tool shader-ls is installed globally."
65+
(string-match-p "shader-ls"
66+
(shell-command-to-string "dotnet tool list -g")))
67+
6368
(defun lsp-shader--server-command ()
6469
"Generate startup command for ShaderLab language server."
6570
(or (and lsp-shader-server-path
6671
(list lsp-shader-server-path "--stdio"))
67-
(list (lsp-package-path 'shader-ls) "--stdio")))
72+
(list "shader-ls" "--stdio")))
6873

6974
(lsp-register-custom-settings
7075
`(("ShaderLab.CompletionWord" lsp-shader-completion-word)))
7176

7277
(lsp-register-client
7378
(make-lsp-client
74-
:new-connection (lsp-stdio-connection #'lsp-shader--server-command)
75-
:activation-fn (lsp-activate-on "shaderlab")
76-
:major-modes '(shader-mode)
79+
:new-connection (lsp-stdio-connection #'lsp-shader--server-command
80+
#'lsp-shader--cls-test-shader-ls-present)
7781
:priority -1
7882
:server-id 'shader-ls
83+
:activation-fn (lsp-activate-on "shaderlab")
84+
:major-modes '(shader-mode)
7985
:download-server-fn #'lsp-shader--cls-download-server))
8086

8187
(provide 'lsp-shader)

0 commit comments

Comments
 (0)