From 49d833fa6466326c6862a8cf134acb9ff3c54741 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 12 Jul 2024 20:27:25 -0400 Subject: [PATCH] fix(gdscript): accommodate version-suffixed godot binaries On some distros (like nixpkgs), the binary is suffixed with a version number. --- modules/lang/gdscript/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/lang/gdscript/config.el b/modules/lang/gdscript/config.el index 7d93f201a..878a76779 100644 --- a/modules/lang/gdscript/config.el +++ b/modules/lang/gdscript/config.el @@ -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))