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

if statements with curly braces inside web forms don't highlight properly #5

Open
happycollision opened this issue Nov 25, 2015 · 6 comments

Comments

@happycollision
Copy link

Just FYI in an ascx file:
screen shot 2015-11-24 at 6 34 06 pm

@happycollision
Copy link
Author

Is this even something that can be addressed in this package, or would it require changes in the c sharp language package?

@jbalboni
Copy link
Owner

jbalboni commented Jan 5, 2016

That's a good question. It's been a while since I worked on this (and even then, a lot of it is copied and pasted), but I believe all the highlighting between <% %> is handed off to the C# highlighter, which may or may not deal well with the fragments of C# you get in as*x files.

@happycollision
Copy link
Author

I just did a little testing with the built in PHP highlighting in Atom, and it handles this scenario just fine. I haven't looked into why it works better in that language, but I suspect that the answer will make itself clear inside that package's code. Maybe @shiftkey has some insight? Or @mnquintana?

@happycollision
Copy link
Author

I made a new language package called ASP HTML to address this issue for myself. Started with the PHP package above and just made a few changes. It works well for this issue, though it is still, at heart, looking for PHP code. Maybe it can help you going forward.

@jbalboni
Copy link
Owner

jbalboni commented Jan 9, 2016

@happycollision Glad you found a solution.

I'm not likely to make changes to this code. I don't use Atom anymore and this is almost entirely a port of grammars and config from Sublime (I think?). If you or anyone else is interested in taking it over, I'm open to that.

@shiftkey
Copy link

Maybe @shiftkey has some insight?

I haven't looked into this (the other examples in the package build upon the C# grammar, and wrapping HTML around the C# might totally confuse things), but perhaps modifying the grammars to look at these extensions might get you some of the way:

https://github.com/atom/language-csharp/blob/master/grammars/c%23.cson

There's examples of incorporating other extensions which extend the C# syntax a bit in the source:

https://github.com/atom/language-csharp/blob/master/grammars/csx.cson

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

3 participants