|
|
|
@ -81,6 +81,12 @@
|
|
|
|
|
(unless (treesit-ready-p 'javascript) (treesit-install-language-grammar 'javascript))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun prettier-fmt ()
|
|
|
|
|
"Run prettier."
|
|
|
|
|
(run-command-on-buffer "prettier" "--stdin-filepath" buffer-file-name)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(use-package css-ts-mode
|
|
|
|
|
:ensure nil
|
|
|
|
|
:pin manual
|
|
|
|
@ -91,6 +97,19 @@
|
|
|
|
|
:init
|
|
|
|
|
(add-to-list 'treesit-language-source-alist '(css "https://github.com/tree-sitter/tree-sitter-css"))
|
|
|
|
|
(unless (treesit-ready-p 'css) (treesit-install-language-grammar 'css))
|
|
|
|
|
:hook (
|
|
|
|
|
(css-ts-mode . (lambda ()
|
|
|
|
|
(eglot-ensure)
|
|
|
|
|
(defclass my/eglot-css (eglot-lsp-server) ()
|
|
|
|
|
:documentation
|
|
|
|
|
"Own eglot server class.")
|
|
|
|
|
|
|
|
|
|
(add-to-list 'eglot-server-programs
|
|
|
|
|
'(css-ts-mode . (my/eglot-css "vscode-css-language-server" "--stdio")))
|
|
|
|
|
;; (add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
|
|
|
|
|
(add-hook 'before-save-hook 'prettier-fmt nil 'local)
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|