fix(gdscript): accommodate version-suffixed godot binaries

On some distros (like nixpkgs), the binary is suffixed with a version
number.
This commit is contained in:
Henrik Lissner 2024-07-12 20:27:25 -04:00
parent 3d99fbf525
commit 49d833fa64
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -25,6 +25,14 @@
;; REVIEW: Maybe it's permissible if `gdscript-docs-local-path' is set?
(setq gdscript-docs-use-eww nil)
;; Some systems append the version number to the executable, so ensure that
;; the path is correct. Note that I avoid setting it to an absolute path to
;; preserve TRAMP support.
(setq gdscript-godot-executable
(cond ((executable-find gdscript-godot-executable) gdscript-godot-executable)
((executable-find "godot") "godot")
((executable-find "godot4") "godot4")))
(when (modulep! +lsp)
(add-hook 'gdscript-mode-local-vars-hook #'lsp! 'append))