Open vjohansen opened 4 months ago
https://github.com/orzechowskid/tree-sitter-css-in-js/blob/0ce23b235748a31b288dd3024624d40413e3f6b8/css-in-js-mode.el#L449
I am trying to upgrade to Emacs-29 and your updated tsx-mode etc.
I get the below when loading a tsx file
fetching CSS-in-JS shared library... Contacting host: github.com:443 Wrote c:/Users/U418662/AppData/Roaming/emacs-29/.emacs.d/tree-sitter/linux.tar.gz File mode specification error: (wrong-type-argument treesit-parser-p nil)
I am on windows so it is weird that it downloads something called linux.tar.gz
In the code (defconst css-in-js-mode--treesit-archive-filename) system-type is checked against 'windows. It should be 'windows-nt
After fixing this I get this in Messages buffer
Wrote c:/Users/U418662/AppData/Roaming/emacs-29/.emacs.d/tree-sitter/windows.tar.gz File mode specification error: (wrong-type-argument treesit-parser-p nil)
with debug-on-error
(car (treesit-parser-list)) fails because (treesit-parser-list) returns nil
Was the download before supposed supposed to install that shuld be returned here?
Debugger entered--Lisp error: (wrong-type-argument treesit-parser-p nil) treesit-parser-language(nil) (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (let nil (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (if (treesit-ready-p 'css-in-js) (progn (set (make-local-variable 'treesit-language-at-point-function) #'css-in-js-mode--get-language-at-pos) (set (make-local-variable 'treesit-range-settings) (append treesit-range-settings (treesit-range-rules 'css-in-js-mode--treesit-set-ranges))) (if css-in-js-mode-force-highlighting (set (make-local-variable 'treesit-font-lock-settings) (append treesit-font-lock-settings css-in-js-mode--font-lock-settings)) (progn (set (make-local-variable 'jit-lock-antiblink-grace) 0) (add-hook 'post-command-hook #'css-in-js-mode--fontify-post-command nil t))) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'append treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'css-in-js-mode--simple-indent) (add-hook 'completion-at-point-functions #'css-in-js-mode--capf nil t) (treesit-major-mode-setup))) t) (cond ((eq css-in-js-mode 't) (let nil (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (if (treesit-ready-p 'css-in-js) (progn (set (make-local-variable 'treesit-language-at-point-function) #'css-in-js-mode--get-language-at-pos) (set (make-local-variable 'treesit-range-settings) (append treesit-range-settings (treesit-range-rules ...))) (if css-in-js-mode-force-highlighting (set (make-local-variable ...) (append treesit-font-lock-settings css-in-js-mode--font-lock-settings)) (progn (set ... 0) (add-hook ... ... nil t))) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'append treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'css-in-js-mode--simple-indent) (add-hook 'completion-at-point-functions #'css-in-js-mode--capf nil t) (treesit-major-mode-setup))) t)) ((null css-in-js-mode) (let nil (treesit-parser-delete (treesit-parser-create 'css-in-js)) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'seq-difference treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'treesit-simple-indent) (remove-hook 'completion-at-point-functions #'css-in-js-mode--capf t) (treesit-major-mode-setup) nil))) (let ((last-message (current-message))) (setq css-in-js-mode (cond ((eq arg 'toggle) (not css-in-js-mode)) ((and (numberp arg) (< arg 1)) nil) (t t))) (if (boundp 'local-minor-modes) (progn (setq local-minor-modes (delq 'css-in-js-mode local-minor-modes)) (if css-in-js-mode (progn (setq local-minor-modes (cons 'css-in-js-mode local-minor-modes)))))) (cond ((eq css-in-js-mode 't) (let nil (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (if (treesit-ready-p 'css-in-js) (progn (set (make-local-variable ...) #'css-in-js-mode--get-language-at-pos) (set (make-local-variable ...) (append treesit-range-settings ...)) (if css-in-js-mode-force-highlighting (set ... ...) (progn ... ...)) (set (make-local-variable ...) (seq-mapn ... treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable ...) #'css-in-js-mode--simple-indent) (add-hook 'completion-at-point-functions #'css-in-js-mode--capf nil t) (treesit-major-mode-setup))) t)) ((null css-in-js-mode) (let nil (treesit-parser-delete (treesit-parser-create 'css-in-js)) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'seq-difference treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'treesit-simple-indent) (remove-hook 'completion-at-point-functions #'css-in-js-mode--capf t) (treesit-major-mode-setup) nil))) (run-hooks 'css-in-js-mode-hook (if css-in-js-mode 'css-in-js-mode-on-hook 'css-in-js-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local " in current buffer")) (message "%s %sabled%s" "Css-In-Js mode" (if css-in-js-mode "en" "dis") local)))))) css-in-js-mode(t) (progn (tsx-mode--debug "configuring css-in-js-mode") (css-in-js-mode-fetch-shared-library) (css-in-js-mode t)) (if tsx-mode-use-css-in-js (progn (tsx-mode--debug "configuring css-in-js-mode") (css-in-js-mode-fetch-shared-library) (css-in-js-mode t)))
should be fixed on main branch by https://github.com/orzechowskid/tree-sitter-css-in-js/pull/33 . thank you!
main
https://github.com/orzechowskid/tree-sitter-css-in-js/blob/0ce23b235748a31b288dd3024624d40413e3f6b8/css-in-js-mode.el#L449
I am trying to upgrade to Emacs-29 and your updated tsx-mode etc.
I get the below when loading a tsx file
I am on windows so it is weird that it downloads something called linux.tar.gz
In the code (defconst css-in-js-mode--treesit-archive-filename) system-type is checked against 'windows. It should be 'windows-nt
After fixing this I get this in Messages buffer
with debug-on-error
(car (treesit-parser-list)) fails because (treesit-parser-list) returns nil
Was the download before supposed supposed to install that shuld be returned here?
Debugger entered--Lisp error: (wrong-type-argument treesit-parser-p nil) treesit-parser-language(nil) (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (let nil (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (if (treesit-ready-p 'css-in-js) (progn (set (make-local-variable 'treesit-language-at-point-function) #'css-in-js-mode--get-language-at-pos) (set (make-local-variable 'treesit-range-settings) (append treesit-range-settings (treesit-range-rules 'css-in-js-mode--treesit-set-ranges))) (if css-in-js-mode-force-highlighting (set (make-local-variable 'treesit-font-lock-settings) (append treesit-font-lock-settings css-in-js-mode--font-lock-settings)) (progn (set (make-local-variable 'jit-lock-antiblink-grace) 0) (add-hook 'post-command-hook #'css-in-js-mode--fontify-post-command nil t))) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'append treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'css-in-js-mode--simple-indent) (add-hook 'completion-at-point-functions #'css-in-js-mode--capf nil t) (treesit-major-mode-setup))) t) (cond ((eq css-in-js-mode 't) (let nil (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (if (treesit-ready-p 'css-in-js) (progn (set (make-local-variable 'treesit-language-at-point-function) #'css-in-js-mode--get-language-at-pos) (set (make-local-variable 'treesit-range-settings) (append treesit-range-settings (treesit-range-rules ...))) (if css-in-js-mode-force-highlighting (set (make-local-variable ...) (append treesit-font-lock-settings css-in-js-mode--font-lock-settings)) (progn (set ... 0) (add-hook ... ... nil t))) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'append treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'css-in-js-mode--simple-indent) (add-hook 'completion-at-point-functions #'css-in-js-mode--capf nil t) (treesit-major-mode-setup))) t)) ((null css-in-js-mode) (let nil (treesit-parser-delete (treesit-parser-create 'css-in-js)) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'seq-difference treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'treesit-simple-indent) (remove-hook 'completion-at-point-functions #'css-in-js-mode--capf t) (treesit-major-mode-setup) nil))) (let ((last-message (current-message))) (setq css-in-js-mode (cond ((eq arg 'toggle) (not css-in-js-mode)) ((and (numberp arg) (< arg 1)) nil) (t t))) (if (boundp 'local-minor-modes) (progn (setq local-minor-modes (delq 'css-in-js-mode local-minor-modes)) (if css-in-js-mode (progn (setq local-minor-modes (cons 'css-in-js-mode local-minor-modes)))))) (cond ((eq css-in-js-mode 't) (let nil (set (make-local-variable 'css-in-js-mode--major-mode-lang) (treesit-parser-language (car (treesit-parser-list)))) (if (treesit-ready-p 'css-in-js) (progn (set (make-local-variable ...) #'css-in-js-mode--get-language-at-pos) (set (make-local-variable ...) (append treesit-range-settings ...)) (if css-in-js-mode-force-highlighting (set ... ...) (progn ... ...)) (set (make-local-variable ...) (seq-mapn ... treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable ...) #'css-in-js-mode--simple-indent) (add-hook 'completion-at-point-functions #'css-in-js-mode--capf nil t) (treesit-major-mode-setup))) t)) ((null css-in-js-mode) (let nil (treesit-parser-delete (treesit-parser-create 'css-in-js)) (set (make-local-variable 'treesit-font-lock-feature-list) (seq-mapn #'seq-difference treesit-font-lock-feature-list css-in-js-mode--font-lock-feature-list)) (set (make-local-variable 'treesit-indent-function) #'treesit-simple-indent) (remove-hook 'completion-at-point-functions #'css-in-js-mode--capf t) (treesit-major-mode-setup) nil))) (run-hooks 'css-in-js-mode-hook (if css-in-js-mode 'css-in-js-mode-on-hook 'css-in-js-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local " in current buffer")) (message "%s %sabled%s" "Css-In-Js mode" (if css-in-js-mode "en" "dis") local)))))) css-in-js-mode(t) (progn (tsx-mode--debug "configuring css-in-js-mode") (css-in-js-mode-fetch-shared-library) (css-in-js-mode t)) (if tsx-mode-use-css-in-js (progn (tsx-mode--debug "configuring css-in-js-mode") (css-in-js-mode-fetch-shared-library) (css-in-js-mode t)))