Fix tsx
This commit is contained in:
parent
df5eed3f28
commit
675d8f21bb
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ projectile-bookmarks.eld
|
||||
recentf
|
||||
settings.el
|
||||
transient/
|
||||
.cache/
|
||||
straight/
|
170
settings.org
170
settings.org
@ -9,12 +9,12 @@
|
||||
(use-package afternoon-theme
|
||||
:ensure t
|
||||
:config
|
||||
;;(load-theme 'afternoon t)
|
||||
(load-theme 'afternoon t)
|
||||
)
|
||||
(use-package modus-themes
|
||||
:ensure t
|
||||
:config
|
||||
(load-theme 'modus-operandi t)
|
||||
;;(load-theme 'modus-operandi t)
|
||||
)
|
||||
#+end_src
|
||||
** UI
|
||||
@ -169,30 +169,30 @@ Setup tree sitter based indentation
|
||||
#+end_src
|
||||
*** tsx
|
||||
#+begin_src emacs-lisp
|
||||
(use-package coverlay
|
||||
:ensure t)
|
||||
|
||||
(use-package origami
|
||||
:ensure t)
|
||||
|
||||
(use-package css-in-js-mode
|
||||
:straight '(css-in-js-mode
|
||||
:type git
|
||||
:host github
|
||||
:repo "orzechowskid/tree-sitter-css-in-js"))
|
||||
|
||||
(use-package corfu
|
||||
:ensure t)
|
||||
|
||||
(setq eglot-server-programs '())
|
||||
(use-package tsx-mode
|
||||
:straight '(tsx-mode
|
||||
:type git
|
||||
:host github
|
||||
:repo "orzechowskid/tsx-mode.el"
|
||||
:branch "emacs29")
|
||||
:config
|
||||
(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . tsx-mode)))
|
||||
;; (use-package coverlay
|
||||
;; :ensure t)
|
||||
;;
|
||||
;; (use-package origami
|
||||
;; :ensure t)
|
||||
;;
|
||||
;; (use-package css-in-js-mode
|
||||
;; :straight '(css-in-js-mode
|
||||
;; :type git
|
||||
;; :host github
|
||||
;; :repo "orzechowskid/tree-sitter-css-in-js"))
|
||||
;;
|
||||
;; (use-package corfu
|
||||
;; :ensure t)
|
||||
;;
|
||||
;; (setq eglot-server-programs '())
|
||||
;; (use-package tsx-mode
|
||||
;; :straight '(tsx-mode
|
||||
;; :type git
|
||||
;; :host github
|
||||
;; :repo "orzechowskid/tsx-mode.el"
|
||||
;; :branch "emacs29")
|
||||
;; :config
|
||||
;; (add-to-list 'auto-mode-alist '("\\.tsx?\\'" . tsx-mode)))
|
||||
#+end_src
|
||||
*** webmode
|
||||
#+begin_src emacs-lisp
|
||||
@ -338,15 +338,16 @@ Set up lsp
|
||||
;;(XXX-mode . lsp-mode)
|
||||
|
||||
;;(typescriptreact-mode . lsp-mode)
|
||||
;;(tsx-mode . lsp-mode)
|
||||
;;(tsx-ts-mode . lsp-mode)
|
||||
(typescript-mode . lsp-mode)
|
||||
(tsx-mode . lsp-mode)
|
||||
(tsx-ts-mode . lsp-mode)
|
||||
(web-mode . lsp-mode)
|
||||
|
||||
(lsp-mode . lsp-enable-which-key-integration))
|
||||
:commands lsp
|
||||
:config
|
||||
(add-hook 'tsx-mode-hook 'lsp-mode))
|
||||
;;(add-hook 'tsx-mode-hook 'lsp-mode)
|
||||
)
|
||||
#+end_src
|
||||
Set up lsp ui
|
||||
#+begin_src emacs-lisp
|
||||
@ -374,6 +375,19 @@ Set up ivy
|
||||
:commands lsp-ivy-workspace-symbol)
|
||||
#+end_src
|
||||
** Flycheck
|
||||
*** Helper function
|
||||
#+begin_src emacs-lisp
|
||||
(defun define-level-info (name severity compilation-level margin-str)
|
||||
(flycheck-define-error-level name
|
||||
:severity severity
|
||||
:compilation-level compilation-level
|
||||
:overlay-category 'flycheck-info-overlay
|
||||
:margin-spec (flycheck-make-margin-spec margin-str 'flycheck-fringe-info)
|
||||
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
|
||||
:fringe-face 'flycheck-fringe-info
|
||||
:error-list-face 'flycheck-error-list-info))
|
||||
#+end_src
|
||||
*** Flycheck
|
||||
#+begin_src emacs-lisp
|
||||
(use-package flycheck
|
||||
:ensure t
|
||||
@ -407,32 +421,9 @@ Set up ivy
|
||||
:fringe-face 'flycheck-fringe-warning
|
||||
:error-list-face 'flycheck-error-list-warning)
|
||||
|
||||
(flycheck-define-error-level 'info
|
||||
:severity -10
|
||||
:compilation-level 0
|
||||
:overlay-category 'flycheck-info-overlay
|
||||
:margin-spec (flycheck-make-margin-spec "🅰" 'flycheck-fringe-info)
|
||||
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
|
||||
:fringe-face 'flycheck-fringe-info
|
||||
:error-list-face 'flycheck-error-list-info)
|
||||
|
||||
(flycheck-define-error-level 'lsp-flycheck-info-unnecessary
|
||||
:severity -10
|
||||
:compilation-level 0
|
||||
:overlay-category 'flycheck-info-overlay
|
||||
:margin-spec (flycheck-make-margin-spec "🅰" 'flycheck-fringe-info)
|
||||
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
|
||||
:fringe-face 'flycheck-fringe-info
|
||||
:error-list-face 'flycheck-error-list-info)
|
||||
|
||||
(flycheck-define-error-level 'hint
|
||||
:severity -20
|
||||
:compilation-level -1
|
||||
:overlay-category 'flycheck-info-overlay
|
||||
:margin-spec (flycheck-make-margin-spec "🆓" 'flycheck-fringe-info)
|
||||
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
|
||||
:fringe-face 'flycheck-fringe-info
|
||||
:error-list-face 'flycheck-error-list-info)
|
||||
(define-level-info 'info -10 0 "🅰")
|
||||
(define-level-info 'lsp-flycheck-info-unnecessary -10 0 "🅰")
|
||||
(define-level-info 'hint -20 -1 "🆓")
|
||||
|
||||
;; …every time Flycheck is activated in a new buffer
|
||||
(add-hook 'flycheck-mode-hook #'my/set-flycheck-margins)
|
||||
@ -444,36 +435,45 @@ Fly check post tip
|
||||
;; :ensure t
|
||||
;; :hook (flycheck-mode . flycheck-pos-tip-mode))
|
||||
#+end_src
|
||||
Fly check inline
|
||||
Fly check inline (disabled because was getting annoyed)
|
||||
#+begin_src emacs-lisp
|
||||
(use-package flycheck-posframe
|
||||
:ensure t
|
||||
:after flycheck
|
||||
:hook (flycheck-mode . flycheck-posframe-mode)
|
||||
:config
|
||||
(flycheck-posframe-configure-pretty-defaults)
|
||||
(setq flycheck-posframe-error-prefix "☣️❤️")
|
||||
(setq flycheck-posframe-warning-prefix "🅰😞")
|
||||
(setq flycheck-posframe-info-prefix "🅰🆓")
|
||||
(set-face-attribute 'flycheck-posframe-error-face
|
||||
nil
|
||||
:inherit nil
|
||||
:foreground "#b72c01")
|
||||
(set-face-attribute 'flycheck-posframe-warning-face
|
||||
nil
|
||||
:foreground "#b77401")
|
||||
|
||||
(set-face-attribute 'flycheck-posframe-info-face
|
||||
nil
|
||||
:foreground "#0156b7")
|
||||
|
||||
(setq flycheck-posframe-border-width 3)
|
||||
(set-face-attribute 'flycheck-posframe-border-face
|
||||
nil
|
||||
:foreground "#dc752f")
|
||||
(add-to-list 'flycheck-posframe-inhibit-functions #'(lambda () company-backend)))
|
||||
;; (use-package flycheck-posframe
|
||||
;; :ensure t
|
||||
;; :after flycheck
|
||||
;; :hook (flycheck-mode . flycheck-posframe-mode)
|
||||
;; :config
|
||||
;; (flycheck-posframe-configure-pretty-defaults)
|
||||
;; (setq flycheck-posframe-error-prefix "☣️❤️")
|
||||
;; (setq flycheck-posframe-warning-prefix "🅰😞")
|
||||
;; (setq flycheck-posframe-info-prefix "🅰🆓")
|
||||
;; (set-face-attribute 'flycheck-posframe-error-face
|
||||
;; nil
|
||||
;; :inherit nil
|
||||
;; :foreground "#b72c01")
|
||||
;; (set-face-attribute 'flycheck-posframe-warning-face
|
||||
;; nil
|
||||
;; :foreground "#b77401")
|
||||
;;
|
||||
;; (set-face-attribute 'flycheck-posframe-info-face
|
||||
;; nil
|
||||
;; :foreground "#0156b7")
|
||||
;;
|
||||
;; (setq flycheck-posframe-border-width 1)
|
||||
;; (setq flycheck-posframe-position 'point-top-left-corner)
|
||||
;;
|
||||
;; (set-face-attribute 'flycheck-posframe-border-face
|
||||
;; nil
|
||||
;; :foreground "#dc752f")
|
||||
;; (add-to-list 'flycheck-posframe-inhibit-functions #'(lambda () company-backend)))
|
||||
#+end_src
|
||||
** TIDE
|
||||
#+begin_src emacs-lisp
|
||||
(use-package tide
|
||||
:ensure t
|
||||
:after (typescript-mode company flycheck)
|
||||
:hook ((typescript-mode . tide-setup)
|
||||
(typescript-mode . tide-hl-identifier-mode)
|
||||
(before-save . tide-format-before-save)))
|
||||
|
||||
|
||||
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode))
|
||||
#+end_src
|
||||
|
Loading…
Reference in New Issue
Block a user