-
Notifications
You must be signed in to change notification settings - Fork 110
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 for Sass variables (and CSS classes) with dashes doesn't work #18
Comments
I can confirm the problem: removed dash from word_separators preference, tested with version 2.0.2, build 2221. As you reported, the word never shows up in the autocomplete list of another view. Unfortunately, this is a bug in the Sublime API implementation (extract_completions method). It's also weird that I sometimes do get a completion in the same view. But if I try again it doesn't show up anymore. However, I always get a completion if I type past the first dash, i.e., "$button-". So, it seems not only the API is broken but also the built in autocomplete is behaving strangely with words containing dashes (and probably other chars). NB, best thing you can probably do is open a bug report for Sublime, but I don't know what the chances are that it gets fixed (someone reported a related problem some time ago but it didn't even get a response...). |
thanks On Thu, Aug 1, 2013 at 1:13 PM, wrndl [email protected] wrote:
twitter.com/adrianlienhard |
Just created temporary hack to make possible dash separated suggestions usage: |
I can confirm that bug We'll we see solution in original master branch? Thanks |
I've just experienced the same thing and written it up on the forum: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=14773 Was a little confused that this fix didn't seem to have landed until I realised this is a fork and needs installing seperately. For anyone else landing here, see the install instructions: https://github.com/andruhon/SublimeAllAutocomplete Thank you so much for the fix! |
I'm still having an issue surrounding this matter. It works when auto completing a class from CSS into HTML, but when you try it the other way around; auto completing a class name from HTML to CSS it doesn't work? I've tried adding "source.html" to "apply_with_dash_hack_syntaxes" with no luck. Thanks for all the work done to date! |
@dntz ,to fix that because ST is ridiculously DUMB
|
Thanks for your help @ctf0, when I bring up the autocomplete box using Ctrl+Space outside a rule set, the classes from my HTML document are now visible. Is there any way to display this autocomplete box automatically? Similar to how it works for properties and values within declarations. |
if i understand u right ,i believe what u r after is that u want the same trick but for css ,well its the same thing ,open any css,less,sass ,etc.. and go to settings-more > syntax specific and add the same thing u add to the html. |
I also don't see this working for SCSS variables. I create a variable in one file that is open:
and in another SCSS file that is open, It simply doesn't work at all. |
Any update on this? I also found that SCSS variables don't work (in that it only suggests the first part of the name and clips off the dash): Example: Both the "-" and "$" have been removed form word_separators. |
Seems like this is still an issue with ST3 |
+1 doesn't work with hyphens in ST3. |
Same problem here, Brackets do that and even show the variable value on the suggested options |
any updates here? @andruhon solution not working for me... |
hey guys, I solved it for me based on hacked version https://github.com/petermac-/SublimeAllAutocomplete repo https://github.com/inomoz/SublimeAllAutocomplete - fixed for me changed only word_regions variable
|
wow, thx @inomoz , you save my life. |
@inomoz looks like this not working after I upgrade to the newest sublime version. |
@inomoz, your repo works for me, but I had to remove This is using Sublime Text 3, build 3114. Since the instructions are kind of all over the place, here are the steps I went through (this is on a Mac, so keystrokes might be different on your machine).
You may have to do this twice if you use both |
@romellem wow~ this works for me, thx! |
@inomoz this doesn't work any more with the latest build v3120 , any chance u can update ur fork ? {
"apply_with_dash_hack_syntaxes": [
"source.scss",
"source.sass",
"source.css",
"text.html.basic",
"text.blade",
"source.php",
"embedding.php",
"source.js",
"source.json"
],
"return_nothing_on_empty_prefix": true,
"do_not_search_in_current_view": false
} user-setting {"word_separators": "./\()\"':,.;<>~!@#%^&*|+=[]{}`~?"} |
I use standard version of ST3 build 3114 with |
@mahish only in the same view, not across open files. |
Using build 3131, not seeing this in action. I don't see any SCSS completions with variables. |
I have 3126 build, word seperator: |
offtop: in Jetbrains IDE autocomplete working even if files not opened (I tried use ctags & plugins for this feature, no success...) |
Based on this issue discussion, for some reason didn't get this in the right place. So if someone misread the whole thing like I did, here's what I did to bypass this problem. In Preferences > Settings, add on any line:
After this, it works. |
Thanks @ronilaukkarinen, works great! |
Thanks guys, @ronilaukkarinen instruction works great :) The repo linked above is offline by now. |
@ronilaukkarinen Thanks. It works! |
After this - "word_separators": "./\()"':,.;<> |
We've split our Sass into multiple files; one of the files contains all our variables. The variables look like this
$variable-name-example
. Unfortunately dashes seam to be a problem currently.Testcase:
Thank you for your plugin, Adrian. Keep up the good work.
The text was updated successfully, but these errors were encountered: