Open kalin-p opened 6 months ago
It should! When I enable this mode on a sample file, I am in major mode WGSL[ts]
and minor modes Auto-Save Corfu Flyspell Font-Lock God-Local Yas
. Do your active modes (I'm just using C-h m
to check) look similar?
Thank you for the quick reply! When I open a .wgsl
I get WGSL[ts]
as a major mode, with minor modes Auto-Save Company Display-Line-Numbers Font-Lock Undo-Tree Visual-Line
.
The trickiest part of tree-sitter grammars in emacs is getting them installed, can you double check that emacs has picked up your WGSL grammar? Running (treesit-language-available-p 'wgsl)
should return t
.
Yeah, it returns t
.
Hey, I noticed that if I try to use wgsl-ts
as a language for an org source code block I get some bizarre error at the line where the #+end_src
is. If is use rust-ts
as a language fontification works correctly.
Additionally when the mode is compiled (when I start emacs) I get these errors:
⛔ Warning (comp): wgsl-ts-mode.el:97:7: Warning: assignment to free variable ‘wgsl-ts-mode--builtins-hash-table’
⛔ Warning (comp): wgsl-ts-mode.el:103:34: Warning: reference to free variable ‘wgsl-ts-mode--builtins-hash-table’
⛔ Warning (comp): wgsl-ts-mode.el:97:7: Warning: assignment to free variable ‘wgsl-ts-mode--builtins-hash-table’
⛔ Warning (comp): wgsl-ts-mode.el:103:34: Warning: reference to free variable ‘wgsl-ts-mode--builtins-hash-table’
It is probably worth mentioning I use straight for package management, although I doubt it is the culprit.
Probably worth changing the setq
to defvar
to address that warning. I think I inherited it from rust-ts-mode
that I adapted. I don't get any error in an org src
block with wgsl-ts
as the language. Can you share the error you see?
I use nix
to build emacs with all my packages rather than straight, but I also don't know exactly how that could be causing trouble.
The mode seems to be working, but I cannot see any syntax highlighting from font-lock-mode (which also seems to be on).