LESS-sublime
LESS-sublime copied to clipboard
Autocomplete variables AFTER a property does not seem to work?
Hi,
First thank you for the project! =)
I have this issue below.
I would expect the variables to auto-complete after a property as well, but it doesn't. Do I need to configure something differently, is my expectation incorrect or is this not (yet) possible?
background-color--1
and others come from a different .less file in the same project folder, so it can find them but just not after a property (where I need them the most:) )
I am on v2.7.4
That first statement looks like it's invalid. It's not a variable assignment, and thus will not show up in completions.
I am not sure what you mean by that, could you clarify?
When I start typing in a .less file starting with the @
sign as shown in the first image, I do get the auto-complete I would expect to get, so showing the auto-complete pop-up window with variables I've defined in other files of the same project.
If you mean the resulting statement
.test {
@background-color--1;
}
won't change the appearance of the class .test
then yes that is correct, but that is not the issue.
On the second image you see the auto-complete pop-up window but it does not show the variables you do see in the first image.
If you mean the .less syntax might now be broken due to the first statement being invalid; this issue still remains also if you change the statements around.
EDIT:
Also defining the variable in the same file has the same issue, if that is what you ment.
Is there anyone with some input on what could be wrong? Would be very much appreciated :)
Hi @braver, would you be able to shed some light on this? Thank you!
The first screenshot seems to show ST's word completions. The second screenshot displays plugin-based auto-completions from less_completions.py
. The plugin disables word completions and doesn't support @vars
on the other hand. Thus no variables are displayed.
Honestly I haven't looked at this syntax for a while now. I have been focussing on SCSS, trying to improve that structurally and in a way that aligns it with the default CSS syntax and keeps it maintainable. I'm not happy with how that is going, but that's the plan: after the 3.0 rewrite improve SCSS further, and then cycle back and rewrite LESS in a similar way. In both syntaxes currently CSS properties are prioritised in completions, and variables, mixins, functions etc. are either not suggested at all or in a very limited way.
Of course, as always, I would definitely welcome contributions and pull requests.
@deathaxe Thank you for your anwser! There probably is not an easy way for the less_completion.py
plugin not to diable the word completions?
@braver Clear, thank you! I am not familiar with this project. Could you point me in the right direction to be able to make a pull request. By that I mean maybe some files and general solution method approach?
Word completions can turned on by removing sublime.INHIBIT_WORD_COMPLETIONS
from https://github.com/danro/LESS-sublime/blob/836b47ec61a9c6a6445b4007e8353337fe63e2c9/less_completions.py#LL649C48-L649C48
@deathaxe This worked! The suggestions are without the "@" sign of the variable but that is not a problem and loads better than no suggestion at all :) Thank you!
@braver Though this is a work-around, for me the issue can be closed if you prefer.
Good. Let's keep it open though, as a reminder that completions need work.
FWIW, word completions are no longer inhibited. This issue can be closed.
Confirmed
Just tested it and it works indeed, thank you! :+1: