-
Notifications
You must be signed in to change notification settings - Fork 84
adjust tag-names match to fix downstream issue in language-less #127
Conversation
Hmm, is there no similar fix for language-less like the one you did for language-sass? I'd like to preserve support for |
@50Wliu Without doing a full rewrite of language-less, I don't think so. The structure of less and sass grammars is wildly different unfortunately. |
That said, I think this fix would have also likely fixed the issue in language-sass without the need to change anything. |
What is wrong with |
No difference, however I'd like to support both methods if possible. |
This PR broke an
Here's the failing line of the test in The issue is that the test's (Atom's CI fails with the latest This test failure is currently blocking the |
This pull request actually caused autocompletions to stop happening for element pseudo-selectors in Steps to reproduce: For example, when typing Expected: Pseudo-selectors such as Actual: Instead, there are no autocompletion suggestions at all until you type another character, for example if you start typing another colon, it works: (Thus, the failing test in Note: pseudo-selectors work as intended in |
This PR addresses a specificity issue in the tag-names matcher which causes a bug in language-less.
Currently, the
tag-names
matcher ends with a postive lookahead of simply a single colon (among other things) after any of the valid tag names is found. The reason this is a problem is because some tag names are also property names (e.g.cursor
,font
,content
, etc).To fix this, all that needed to happen is a slight adjustment to the regex to increase the specificity to match only colons followed by a non-space.
Drawbacks
There really is no other way I can think of other than having the selector match a colon followed by a non-space because of all the possibilities with pseudo selectors, child selectors, etc. Because of that, there will still be a mistake in some situations where the user forgets to add a space between property keys and values that match tag names. IMHO, that's not the end of the world though.
Relevant:
Fixes atom/language-less#79