merge: pull request #5401 from jeetelongname/tree-sitter
This commit is contained in:
commit
173396a963
52 changed files with 515 additions and 24 deletions
|
@ -38,3 +38,9 @@
|
|||
"h" #'agda2-display-implicit-arguments
|
||||
"q" #'agda2-quit
|
||||
"r" #'agda2-restart)))
|
||||
|
||||
;; Tree Sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! '(agda-mode-local-vars-hook
|
||||
agda2-mode-local-vars-hook)
|
||||
#'tree-sitter!))
|
||||
|
|
5
modules/lang/agda/doctor.el
Normal file
5
modules/lang/agda/doctor.el
Normal file
|
@ -0,0 +1,5 @@
|
|||
;;; lang/agda/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
|
@ -304,3 +304,9 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
|
|||
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
||||
"-isystem/usr/local/include"]
|
||||
:resourceDir (cdr (doom-call-process "clang" "-print-resource-dir"))))))))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook)
|
||||
#'tree-sitter!))
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(when (require 'rtags nil t)
|
||||
;; rtags
|
||||
(when-let (bins (cl-remove-if #'rtags-executable-find
|
||||
|
|
|
@ -72,3 +72,7 @@ or terminating simple string."
|
|||
|
||||
|
||||
(use-package! sln-mode :mode "\\.sln\\'")
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'csharp-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -5,3 +5,7 @@
|
|||
(let ((omnisharp-bin (or omnisharp-server-executable-path (omnisharp--server-installation-path t))))
|
||||
(unless (file-exists-p omnisharp-bin)
|
||||
(warn! "Omnisharp server isn't installed, completion won't work"))))
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
|
|
@ -99,3 +99,6 @@
|
|||
"T" #'exunit-toggle-file-and-test
|
||||
"t" #'exunit-toggle-file-and-test-other-window
|
||||
"s" #'exunit-verify-single))
|
||||
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'elixir-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
6
modules/lang/elixir/doctor.el
Normal file
6
modules/lang/elixir/doctor.el
Normal file
|
@ -0,0 +1,6 @@
|
|||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lang/elixir/doctor.el
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
|
@ -21,3 +21,7 @@
|
|||
:when (featurep! :checkers syntax)
|
||||
:after elm-mode
|
||||
:config (add-to-list 'flycheck-checkers 'elm))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'elm-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
5
modules/lang/elm/doctor.el
Normal file
5
modules/lang/elm/doctor.el
Normal file
|
@ -0,0 +1,5 @@
|
|||
;;; lang/elm/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
|
@ -76,3 +76,7 @@
|
|||
(use-package! flycheck-golangci-lint
|
||||
:when (featurep! :checkers syntax)
|
||||
:hook (go-mode . flycheck-golangci-lint-setup))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'go-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "guru")
|
||||
(warn! "Couldn't find guru. Refactoring commands (go-guru-*) won't work"))
|
||||
|
||||
|
|
|
@ -49,3 +49,7 @@ If the depth is 2, the first two directories are removed: net.lissner.game.")
|
|||
(set-docsets! 'groovy-mode "Groovy" "Groovy_JDK")
|
||||
(set-eval-handler! 'groovy-mode "groovy")
|
||||
(set-repl-handler! 'groovy-mode #'+java/open-groovy-repl))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'java-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "javac")
|
||||
(warn! "Couldn't find the javac executable, are you sure the JDK is installed?"))
|
||||
|
||||
|
|
|
@ -127,7 +127,16 @@
|
|||
(define-derived-mode typescript-tsx-mode web-mode "TypeScript-TSX")
|
||||
(when (featurep! +lsp)
|
||||
(after! lsp-mode
|
||||
(add-to-list 'lsp--formatting-indent-alist '(typescript-tsx-mode . typescript-indent-level)))))
|
||||
(add-to-list 'lsp--formatting-indent-alist '(typescript-tsx-mode . typescript-indent-level))))
|
||||
(when (featurep! +tree-sitter)
|
||||
(after! tree-sitter
|
||||
(pushnew! tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))
|
||||
(pushnew! evil-textobj-tree-sitter-major-mode-language-alist '(typescript-tsx-mode . "tsx"))
|
||||
|
||||
;; HACK: the tsx grammer doesn't work with the hightlighting provided by
|
||||
;; font-lock-keywords. See emacs-tree-sitter/tree-sitter-langs#23
|
||||
(setq-hook! 'typescript-tsx-mode-hook
|
||||
tree-sitter-hl-use-font-lock-keywords nil))))
|
||||
|
||||
(set-docsets! '(typescript-mode typescript-tsx-mode)
|
||||
:add "TypeScript" "AngularTS")
|
||||
|
@ -311,3 +320,12 @@ to tide."
|
|||
|
||||
(def-project-mode! +javascript-gulp-mode
|
||||
:when (locate-dominating-file default-directory "gulpfile.js"))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! '(js-mode-local-vars-hook
|
||||
js2-mode-local-vars-hook
|
||||
typescript-mode-local-vars-hook
|
||||
typescript-tsx-mode-local-vars-hook
|
||||
rjsx-mode-local-vars-hook)
|
||||
#'tree-sitter!))
|
||||
|
|
|
@ -4,3 +4,7 @@
|
|||
(assert! (or (not (featurep! +lsp))
|
||||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
|
|
@ -29,3 +29,8 @@
|
|||
:map json-mode-map
|
||||
:localleader
|
||||
"s" #'counsel-jq))
|
||||
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! '(json-mode-local-vars-hook
|
||||
jsonc-mode-local-vars-hook)
|
||||
#'tree-sitter!))
|
||||
|
|
|
@ -3,3 +3,7 @@
|
|||
(when (and (featurep! :completion ivy)
|
||||
(not (executable-find "jq")))
|
||||
(warn! "Couldn't find jq. counsel-jq won't work." ))
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
|
|
@ -99,3 +99,7 @@
|
|||
;; Prevent timeout while installing LanguageServer.jl
|
||||
(setq-hook! 'julia-mode-hook eglot-connect-timeout (max eglot-connect-timeout 60))
|
||||
:config (eglot-jl-init))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'julia-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(let ((args
|
||||
(cond ((require 'eglot-jl nil t)
|
||||
|
|
|
@ -47,3 +47,7 @@
|
|||
|
||||
(use-package! nix-repl
|
||||
:commands nix-repl-show)
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'nix-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -7,3 +7,6 @@
|
|||
(unless (executable-find "nixfmt")
|
||||
(warn! "Couldn't find nixfmt. nix-format-buffer won't work."))
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
|
|
@ -118,3 +118,7 @@
|
|||
((equal ext ".eliomi")
|
||||
(setq-local ocamlformat-file-kind 'interface)))))
|
||||
(setq +format-with 'ocamlformat))))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'tuareg-mode-local-vars-hook #'tree-sitter))
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "ocamlmerlin")
|
||||
(warn! "Couldn't find ocamlmerlin. Lookup, completion and syntax checking won't work"))
|
||||
|
||||
|
|
|
@ -176,3 +176,7 @@
|
|||
:on-exit
|
||||
(setq phpunit-args nil
|
||||
phpunit-executable nil))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'php-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -4,3 +4,7 @@
|
|||
(assert! (or (not (featurep! +lsp))
|
||||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
|
|
@ -345,3 +345,7 @@
|
|||
(use-package! lsp-pyright
|
||||
:when (featurep! +pyright)
|
||||
:after lsp-mode))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'python-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(if (not (or (executable-find "python")
|
||||
(executable-find "python3")))
|
||||
(error! "Couldn't find python in your PATH")
|
||||
|
|
|
@ -195,3 +195,7 @@
|
|||
(map! :localleader
|
||||
:map projectile-rails-mode-map
|
||||
"r" #'projectile-rails-command-map))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'ruby-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "ruby")
|
||||
(warn! "Ruby isn't installed."))
|
||||
|
||||
|
|
|
@ -81,3 +81,7 @@
|
|||
(set-lookup-handlers! 'rustic-mode
|
||||
:definition '(racer-find-definition :async t)
|
||||
:documentation '+rust-racer-lookup-documentation))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'rustic-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "rustc")
|
||||
(warn! "Couldn't find rustc binary"))
|
||||
|
||||
|
|
|
@ -50,3 +50,7 @@
|
|||
(use-package! sbt-mode
|
||||
:after scala-mode
|
||||
:config (set-repl-handler! 'scala-mode #'+scala/open-repl :persist t))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'scala-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(if (and (featurep! +lsp)
|
||||
(not (executable-find "metals-emacs")))
|
||||
(warn! "metals-emacs isn't installed"))
|
||||
|
|
|
@ -93,3 +93,7 @@
|
|||
:config
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'powershell-mode-local-vars-hook #'lsp! 'append)))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'sh-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -3,3 +3,7 @@
|
|||
(when (featurep! :checkers syntax)
|
||||
(unless (executable-find "shellcheck")
|
||||
(warn! "Couldn't find shellcheck. Shell script linting will not work")))
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
|
|
@ -31,3 +31,7 @@
|
|||
"sourcekit"
|
||||
"/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/sourcekit-lsp"
|
||||
"/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/sourcekit"))))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'swift-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
5
modules/lang/swift/doctor.el
Normal file
5
modules/lang/swift/doctor.el
Normal file
|
@ -0,0 +1,5 @@
|
|||
;;; lang/swift/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
|
@ -55,3 +55,10 @@
|
|||
(def-project-mode! +web-phaser-mode
|
||||
:modes '(+javascript-npm-mode)
|
||||
:when (+javascript-npm-dep-p '(or phaser phaser-ce))))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! '(html-mode-local-vars-hook
|
||||
mhtml-mode-local-vars-hook
|
||||
css-mode-local-vars-hook)
|
||||
#'tree-sitter!))
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "js-beautify")
|
||||
(warn! "Couldn't find js-beautify. Code formatting in JS/CSS/HTML modes will not work."))
|
||||
|
||||
|
|
|
@ -30,3 +30,6 @@
|
|||
"f" #'zig-format-buffer
|
||||
"r" #'zig-run
|
||||
"t" #'zig-test-buffer))
|
||||
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! 'zig-mode-local-vars-hook #'tree-sitter!))
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(unless (executable-find "zig")
|
||||
(warn! "Couldn't find zig binary"))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue