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

{{ $something }} highlighting broken inside HTML parameters #21

Closed
Ingramz opened this issue Jun 3, 2015 · 7 comments
Closed

{{ $something }} highlighting broken inside HTML parameters #21

Ingramz opened this issue Jun 3, 2015 · 7 comments
Labels
bug The issue is a defect of this package.

Comments

@Ingramz
Copy link
Collaborator

Ingramz commented Jun 3, 2015

Using "Atom Dark" theme:
source_hack

The reason why the first } is colored differently is because it's nearest class is source, which is/was required to get autocomplete to detect scope in situations where the cursor is right before the ending brace. With recent improvements to autocomplete, it needs to investigated whether we need the hack anymore or should we go with PHP-s solution where a workaround has been applied (https://github.com/atom/atom-dark-syntax/blob/master/index.less#L179) - that would change the color of the curly braces.

@Ingramz
Copy link
Collaborator Author

Ingramz commented Nov 11, 2015

Autocomplete uses the same ctrl+alt+shift+p scope names at cursor, which means that currently it's not possible to achieve the desired effect without a grammar scope dedicated to the right side character from the cursor. This is because first-mate only outputs tokens for characters and does not allow for zero-width tokens. These tokens could be the solution for more accurate cursor scopes.

It is also pretty much impossible to please everyone with the choice of scope names for those opening and closing tags. As discussed before in other issues/pull requests, I believe that semantic scope names are better, even if they look ugly with your favorite theme, because they encourage theme designers to do it right as well.

I hope there is a better solution available or at least we should be aiming towards getting the underlying issues fixed, not apply temporary (read: permanent) hacks one after another without a plan to remove them later. Fixing it manually in CSS should do in the meanwhile, I can post the snippet if someone wants.

@Gawdl3y
Copy link

Gawdl3y commented Jan 16, 2016

@Ingramz Mind sharing that CSS snippet?

@Ingramz
Copy link
Collaborator Author

Ingramz commented Jan 16, 2016

Actually I came up with a better solution to the problem. Update to the latest version to see if it works for you.

@Gawdl3y
Copy link

Gawdl3y commented Jan 18, 2016

Interesting, I thought the issue was about the syntax highlighting almost entirely breaking down within HTML parameters, not just the closing brace. This is what I see:
image

I'm using the Ax Monokai syntax theme.

@Ingramz
Copy link
Collaborator Author

Ingramz commented Jan 18, 2016

@Gawdl3y that's just a theme that doesn't handle this corner case properly. You can try placing into one of the parameters <?php echo asset('favicon.png'); ?>, which is the PHP-equivalent. If I remember correctly, then Monokai only will color echo and rest would look like on the picture above, so it's supposed to be like that.

This issue is/was about the closing } characters being different color with some themes.

@Gawdl3y
Copy link

Gawdl3y commented Jan 21, 2016

What is necessary to get the syntax theme working correctly for this? See alexbarton/atom-ax-monokai-syntax#1

@Ingramz
Copy link
Collaborator Author

Ingramz commented Jan 21, 2016

@Gawdl3y depends what do you mean by "correctly". It could easily be that the author of the theme intended for it to look like this. It's not "broken", but rather "unstyled".

@Ingramz Ingramz closed this as completed Mar 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a defect of this package.
Projects
None yet
Development

No branches or pull requests

2 participants