Add cmake support to emacs.

This commit is contained in:
Tom Alexander 2025-01-25 10:20:02 -05:00
parent 1ebf31dc11
commit 7d94210d8f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 22 additions and 0 deletions

View File

@ -127,6 +127,8 @@ in
final.nixfmt-rfc-style # auto-formatting nix files through nixd
final.clang # To compile tree-sitter grammars
final.shellcheck
final.cmake-language-server
final.cmake # Used by cmake-language-server
]
}
'';

View File

@ -0,0 +1,18 @@
(require 'common-lsp)
(use-package cmake-mode
:commands cmake-mode
:hook (
(cmake-mode . (lambda ()
(eglot-ensure)
(defclass my/eglot-cmake (eglot-lsp-server) ()
:documentation
"Own eglot server class.")
(add-to-list 'eglot-server-programs
'(cmake-mode . (my/eglot-cmake "cmake-language-server")))
))
)
)
(provide 'lang-cmake)

View File

@ -38,4 +38,6 @@
(require 'lang-nix)
(require 'lang-cmake)
(load-directory autoload-directory)