Closed braver closed 5 years ago
Three comments:
I find that when I'm looking for where I put the rules for .foo-class
in CSS, the Goto is moderately helpful. It's somewhat less so in SCSS because the Goto doesn't show you what the current hierarchy (&
) is. You have to actually visit the Goto target and look at the hierarchy.
If you do the same sort of prefixing with Variables and Mixins, the Goto still lets you type something like var blue
to get to the variables with blue
in their name.
I tried at one point to break up ,
selectors for Goto purposes (change source.css meta.selector
to source.css meta.selector - punctuation.separator
). The problem with this is that white-space-only entries are put into the index.
Yeah, for CSS being able to find a selector that way can be nice, but you can use search for that as well. And if you lean on nested selectors a lot (and you should), the usefulness drops pretty hard. I think the important part for Sass is to be able to jump to mixin and variable definitions, that’s what I want to get working with this.
In 2.2.2 the symbol list now includes mixins and functions and restores the Goto feature for them. Variables aren't usually included in the symbol list so I'm leaving them out for now. If anyone has more ideas about this let me know.
I think I'm going to keep it as it is. The local symbol list shows selectors, with their indentation so you can see their nesting. The global symbol list allows you to jump to the definition of mixins, which is super useful. I don't think other syntaxes support "goto variable definition", and that might just add a lot of noise.
Right now the symbol list shows all selectors. I never found this to be very useful. Instead, I would suggest changing it to list the variables and mixins. This would allow you to quickly jump to their definitions. Of course such a change has a lot of impact, so if someone reads this and want to have a say in it, you're welcome!