mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-02 14:53:38 -05:00
feat(qt): add treesit (and lsp) support
This commit is contained in:
@@ -13,10 +13,16 @@ This module provides language functionality for [[https://qt.io][Qt]] specific f
|
|||||||
*This module needs a maintainer.* [[doom-contrib-maintainer:][Become a maintainer?]]
|
*This module needs a maintainer.* [[doom-contrib-maintainer:][Become a maintainer?]]
|
||||||
|
|
||||||
** Module flags
|
** Module flags
|
||||||
/This module has no flags./
|
- +lsp ::
|
||||||
|
Enable LSP support for ~qml-mode~/~qml-ts-mode~. Requires [[doom-module::tools lsp]]
|
||||||
|
and a langserver (supports [[https://doc.qt.io/qt-6/qtqml-tooling-qmlls.html][qmlls]]).
|
||||||
|
- +tree-sitter ::
|
||||||
|
Leverages tree-sitter for better syntax highlighting and structural text
|
||||||
|
editing. Requires [[doom-module::tools tree-sitter]].
|
||||||
|
|
||||||
** Packages
|
** Packages
|
||||||
- [[doom-package:qml-mode]]
|
- [[doom-package:qml-mode]]
|
||||||
|
- [[doom-package:qml-ts-mode]] if [[doom-module:+tree-sitter]]
|
||||||
- [[doom-package:qt-pro-mode]]
|
- [[doom-package:qt-pro-mode]]
|
||||||
|
|
||||||
** Hacks
|
** Hacks
|
||||||
|
@@ -2,3 +2,13 @@
|
|||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(add-to-list 'auto-mode-alist '("\\.pr[io]\\'" . qt-pro-mode))
|
(add-to-list 'auto-mode-alist '("\\.pr[io]\\'" . qt-pro-mode))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(when (modulep! +tree-sitter)
|
||||||
|
(set-tree-sitter! 'qml-mode 'qml-ts-mode
|
||||||
|
'((qmljs :url "https://github.com/yuja/tree-sitter-qmljs"))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(when (modulep! +lsp)
|
||||||
|
(add-hook 'qml-mode-local-vars-hook #'lsp! 'append)
|
||||||
|
(add-hook 'qml-ts-mode-local-vars-hook #'lsp! 'append))
|
||||||
|
9
modules/lang/qt/doctor.el
Normal file
9
modules/lang/qt/doctor.el
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
;;; lang/qt/doctor.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(assert! (or (not (modulep! +lsp))
|
||||||
|
(modulep! :tools lsp))
|
||||||
|
"This module requires (:tools lsp)")
|
||||||
|
|
||||||
|
(assert! (or (not (modulep! +tree-sitter))
|
||||||
|
(modulep! :tools tree-sitter))
|
||||||
|
"This module requires (:tools tree-sitter)")
|
@@ -3,3 +3,9 @@
|
|||||||
|
|
||||||
(package! qml-mode :pin "6c5f33ba88ae010bf201a80ee8095e20a724558c")
|
(package! qml-mode :pin "6c5f33ba88ae010bf201a80ee8095e20a724558c")
|
||||||
(package! qt-pro-mode :pin "7a2da323de834294b413cbbb3c92f42f54913643")
|
(package! qt-pro-mode :pin "7a2da323de834294b413cbbb3c92f42f54913643")
|
||||||
|
|
||||||
|
(when (modulep! +tree-sitter)
|
||||||
|
(package! qml-ts-mode
|
||||||
|
:recipe (:host github
|
||||||
|
:repo "xhcoding/qml-ts-mode")
|
||||||
|
:pin "b80c6663521b4d0083e416e6712ebc02d37b7aec"))
|
||||||
|
Reference in New Issue
Block a user