SublimeText / Sass

Sass and SCSS syntax for Sublime Text
https://packagecontrol.io/packages/Sass
MIT License
50 stars 8 forks source link

Autocomplete stops working before a nested selector #107

Closed ohboylan closed 4 months ago

ohboylan commented 4 months ago

When adding a new css property to the end of a property list, autocomplete stops working if there's a nested selector immediately following the new property. The type of nested selector doesn't seem to matter, it could be an &, a mixin, class, etc.

Tested in Windows and MacOS on the current stable build of ST4. Also tested in a clean install with only the Sass package installed with the same results.

Here's an example of autocomplete not working: 1-autocomplete-not-working

And here's an example of autocomplete working as normal, when adding a property to the top of the list: 2-autocomplete-working

deathaxe commented 4 months ago

Syntactically border- is scoped as custom tag and thus part of the selector, which h2 belongs to, too.

That's how nested CSS works, syntactically. Properties are identified by following semi-colon. Any other chain of tokens foo bar : baz followed by { belongs to a selector, even if located on separate lines.

Properties are not suggested via auto-completions, within selectors.

That's working as expected.

ohboylan commented 4 months ago

That's absolutely correct, I can see Stylelint processing it as a selector instead of a property. However, when writing scss, I would expect it to be handled as a property. Having to add properties between existing ones in order to use autocomplete feels clunky.

If anyone else is running this issue - I've switched to LSP-css autocomplete for now, as they work as I would expect.

deathaxe commented 4 months ago

Maybe removing meta.selector restriction is enough. Let's try to suggest properties, everywhere.