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

Treesitter for ease of theming languages #71

Open
vinniefranco opened this issue Apr 5, 2024 · 3 comments
Open

Treesitter for ease of theming languages #71

vinniefranco opened this issue Apr 5, 2024 · 3 comments
Labels

Comments

@vinniefranco
Copy link

Hello!

Awesome project! I'm wondering if we could remove some build steps, reduce deps and leverage some of the features that exist in most peoples nvim setups.

For example: https://tree-sitter.github.io/tree-sitter/syntax-highlighting have you considered treesitter for handling the syntax highlighting duties?

@mistricky
Copy link
Owner

Hi there, thx for your advice.

The Syntax highlighting is implemented by syntect, AFAIUI the tree-sitter is a lower-level lib compared to syntect. For generating an image, need to calculate the color byte vector of the image, would there be a significant amount of work involved in using tree-sitter than using syntect?

@aegonz
Copy link

aegonz commented Apr 5, 2024

I am not sure if this is related but while testing the latest change for Dockerfile/Pipfile support the syntax highlight only works if you select from the top of the file not in the middle of the file on a random line

@vinniefranco
Copy link
Author

vinniefranco commented Apr 5, 2024

image

@mistricky I was thinking that treesitter is already there. It knows when it's an expression/keyword/etc regardless of file type (assuming you have the grammar installed) or where you select from a file. All the highlighting definition work has been done: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/forth/highlights.scm

Additionally, python+rust+lua+linked libs+shell scripts might be hurt your portability/plugin adoption...

Anyways, while I'm not aware of the LOE for tearing out syntect/Rust. It might be a boon for formatting/theming work. As ts could provide the heavy lifting and, if needed, nvim's lua API could provide the tab rules and file type.

Food for thought :)

@mistricky mistricky added the idea label Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants