File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -60,22 +60,28 @@ Will update if UPDATE? is t"
60
60
error-callback
61
61
" dotnet" " tool" (if update? " update" " install" ) " -g" " shader-ls" ))
62
62
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
+
63
68
(defun lsp-shader--server-command ()
64
69
" Generate startup command for ShaderLab language server."
65
70
(or (and lsp-shader-server-path
66
71
(list lsp-shader-server-path " --stdio" ))
67
- (list (lsp-package-path ' shader-ls) " --stdio" )))
72
+ (list " shader-ls" " --stdio" )))
68
73
69
74
(lsp-register-custom-settings
70
75
`((" ShaderLab.CompletionWord" lsp-shader-completion-word)))
71
76
72
77
(lsp-register-client
73
78
(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 )
77
81
:priority -1
78
82
:server-id 'shader-ls
83
+ :activation-fn (lsp-activate-on " shaderlab" )
84
+ :major-modes '(shader-mode)
79
85
:download-server-fn #'lsp-shader--cls-download-server ))
80
86
81
87
(provide 'lsp-shader )
You can’t perform that action at this time.
0 commit comments