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

Feature request: support for leptos #21

Open
chris-kruining opened this issue Mar 6, 2023 · 1 comment
Open

Feature request: support for leptos #21

chris-kruining opened this issue Mar 6, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@chris-kruining
Copy link

I have tested this plugin by changing only the name of the macro view to html. and it seemed to work fine. is there any chance you are willing to add highligthing for leptos?

looking at the syntax highlighting code I think this should work:

{
	"scopeName": "source.rust.yew",
	"injectionSelector": "L:source.rust",
	"patterns": [
		{
			"include": "#view-macro"
		},
		{
			"include": "#rust-brackets"
		}
	],
	"repository": {
		"view-macro": {
			"name": "source.rust.leptos.view",
			"begin": "view! {",
			"end": "}",
			"beginCaptures": {
				"0": {
					"name": "punctuation.macro.open"
				}
			},
			"endCaptures": {
				"0": {
					"name": "punctuation.macro.close"
				}
			},
			"patterns": [
				{
					"include": "source.js.jsx"
				}
			]
		},
		"rust-brackets": {
			"name": "source.rust.leptos",
			"begin": "{",
			"end": "}",
			"patterns": [
				{
					"include": "source.rust"
				}
			]
		}
	}
}
@ttax00
Copy link
Owner

ttax00 commented Apr 1, 2023

Hello! Sorry for the late reply.

I haven't play around with leptos yet, but from the looks of your example, i assume the view! macro takes the same syntax as jsx? Feel free to open a PR, since language configurations shouldn't cause much incompatibility issues.

And as always, thanks for filing the issue 😄

@ttax00 ttax00 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants