Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Almost no font lock, only minimal in script block #8

Closed
efim opened this issue Mar 11, 2024 · 1 comment
Closed

Almost no font lock, only minimal in script block #8

efim opened this issue Mar 11, 2024 · 1 comment

Comments

@efim
Copy link

efim commented Mar 11, 2024

Hello!

I'm having trouble figuring out font locking,
when i enable 'templ-ts-mode' only few items inside of script block have color

My initially attempted setup is no-distribution just emacs config:
templ-ts-no-font-lock-2024-03-11_06-13

as seen in screenshot, i've enabled tree-sitter-explorer, and file has been parsed

this is minimal setup i've used to recreate same behavior in emacs -Q:

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
(package-install 'templ-ts-mode)  ; Assuming templ-ts-mode is available in the package repository

;; manual javascript tree-sitter grammar install with
;; M-x treesit-install-language-grammar javascript

in Messages i get following error:
Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 2 "(function name: (identifier) @font-lock-function-name-face) (class_declaration name: (identifier) @font-lock-type-face) (function_declaration name: (identifier) @font-lock-function-name-face) (method_definition name: (property_identifier) @font-lock-function-name-face) (method_definition parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) (arrow_function parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) (function_declaration parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) (variable_declarator name: (identifier) @font-lock-variable-name-face) (variable_declarator name: (identifier) @font-lock-function-name-face value: [(function) (arrow_function)]) (variable_declarator name: [(array_pattern (identifier) @font-lock-variable-name-face) (object_pattern (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) (import_clause (identifier) @font-lock-variable-name-face) (import_clause (named_imports (import_specifier alias: (identifier) @font-lock-variable-name-face))) (import_clause (named_imports (import_specifier !alias name: (identifier) @font-lock-variable-name-face))) (import_clause (namespace_import (identifier) @font-lock-variable-name-face))" "Debug the query with `treesit-query-validate'")

Error during redisplay: (jit-lock-function 101) signaled (treesit-query-error "Node type error at" 2 "(function name: (identifier) @font-lock-function-name-face) (class_declaration name: (identifier) @font-lock-type-face) (function_declaration name: (identifier) @font-lock-function-name-face) (method_definition name: (property_identifier) @font-lock-function-name-face) (method_definition parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) (arrow_function parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) (function_declaration parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) (variable_declarator name: (identifier) @font-lock-variable-name-face) (variable_declarator name: (identifier) @font-lock-function-name-face value: [(function) (arrow_function)]) (variable_declarator name: [(array_pattern (identifier) @font-lock-variable-name-face) (object_pattern (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) (import_clause (identifier) @font-lock-variable-name-face) (import_clause (named_imports (import_specifier alias: (identifier) @font-lock-variable-name-face))) (import_clause (named_imports (import_specifier !alias name: (identifier) @font-lock-variable-name-face))) (import_clause (namespace_import (identifier) @font-lock-variable-name-face))" "Debug the query with `treesit-query-validate'")

Am I missing something?
Maybe there is some dependency i need, which is not installed automatically?

I understand that error message asks to check treesit query, but right now i don't know how to do that

@efim
Copy link
Author

efim commented Mar 11, 2024

Oh, now i see that this is duplicate of the #6

@efim efim closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant