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

More support #1

Open
doomgutt opened this issue Jun 26, 2024 · 3 comments
Open

More support #1

doomgutt opened this issue Jun 26, 2024 · 3 comments

Comments

@doomgutt
Copy link

Hey, I've been trying to find a way to get some highlighting for hyperscript in neovim and so far it hasn't worked yet. I can't tell if i'm configuring treesitter wrong or this parser is out of date.

Any support at all would be great, thanks.

@ignamartinoli
Copy link

ignamartinoli commented Jul 29, 2024

Hey @doomgutt, I was able to at least tell nvim-treesitter how to install this grammar.

If you're using Lazy, in the init section of nvim-treesitter I wrote:

init = function ()
	local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
	parser_config._hyperscript = {
		filetype = 'hyperscript',
		install_info = {
			url = 'https://github.com/dz4k/tree-sitter-_hyperscript',
			files = { 'src/parser.c' },
			branch = 'main',
			requires_generate_from_grammar = false,
		}
	}
end

What is needed now, is to inject the grammar on top of HTML when there is a _ or data-script tag.

I really have no clue how to do it, and it seems quite the rabbit hole.

@ignamartinoli
Copy link

I have the suspicion it has to do with this file https://github.com/tree-sitter/tree-sitter-html/blob/master/queries/injections.scm

@ignamartinoli
Copy link

Opened tree-sitter/tree-sitter-html#103

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

2 participants