mirror of
https://github.com/godotengine/emacs-gdscript-mode.git
synced 2026-01-04 18:09:55 +03:00
Add gdscript-eglot--get-config-dir function
This commit is contained in:
@@ -42,6 +42,14 @@
|
|||||||
"The version of godot in use."
|
"The version of godot in use."
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defun gdscript-eglot--get-config-dir ()
|
||||||
|
(pcase system-type
|
||||||
|
('darwin "~/Library/Application Support/Godot/")
|
||||||
|
('windows-nt (substitute-in-file-name "$APPDATA/Godot/"))
|
||||||
|
('gnu/linux (file-name-concat
|
||||||
|
(or (getenv "XDG_CONFIG_HOME") "~/.config/")
|
||||||
|
"godot"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun gdscript-eglot-contact (_interactive)
|
(defun gdscript-eglot-contact (_interactive)
|
||||||
"Attempt to help `eglot' contact the running gdscript LSP.
|
"Attempt to help `eglot' contact the running gdscript LSP.
|
||||||
@@ -52,12 +60,7 @@ definitions of HOST, PORT, and INTERACTIVE.
|
|||||||
For more context, see
|
For more context, see
|
||||||
https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-04/msg01070.html."
|
https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-04/msg01070.html."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let* ((config-dir (pcase system-type
|
(let* ((config-dir (gdscript-eglot--get-config-dir))
|
||||||
('darwin "~/Library/Application Support/Godot/")
|
|
||||||
('windows-nt (substitute-in-file-name "$APPDATA/Godot/"))
|
|
||||||
('gnu/linux (file-name-concat
|
|
||||||
(or (getenv "XDG_CONFIG_HOME") "~/.config/")
|
|
||||||
"godot"))))
|
|
||||||
(settings-file (file-name-concat
|
(settings-file (file-name-concat
|
||||||
config-dir
|
config-dir
|
||||||
(format "editor_settings-%s.tres" gdscript-eglot-version))))
|
(format "editor_settings-%s.tres" gdscript-eglot-version))))
|
||||||
|
|||||||
Reference in New Issue
Block a user