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

Autocomplete stops working before a nested selector #107

Closed
ohboylan opened this issue Apr 23, 2024 · 3 comments · Fixed by #108
Closed

Autocomplete stops working before a nested selector #107

ohboylan opened this issue Apr 23, 2024 · 3 comments · Fixed by #108
Labels
enhancement New feature or request

Comments

@ohboylan
Copy link

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
Copy link
Member

deathaxe commented May 6, 2024

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.

@deathaxe deathaxe added the question Further information is requested label May 6, 2024
@deathaxe deathaxe closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
@ohboylan
Copy link
Author

ohboylan commented May 6, 2024

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 added a commit that referenced this issue May 6, 2024
Resolves #107

Suggest properties also within `meta.selector` as this is the most likely
scope in front of a nested selector, if a property is not yet terminated by
semi-colon.
@deathaxe deathaxe reopened this May 6, 2024
@deathaxe
Copy link
Member

deathaxe commented May 6, 2024

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

@deathaxe deathaxe added enhancement New feature or request and removed question Further information is requested labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants