Bootstrap class autocomplete in *.html.erb

I have IntelliJ 13.1 with Ruby plugin installed. My Rails project is properly set up to use the 'bootstrap-sass' gem and works fine in the browser.

As per Rails convention I have a file (app/assets/stylesheets/custom.css.scss) which @imports "bootstrap" on its first line and contains custom styles. Autocompletion works (almost) fine within this file (ie Bootstrap variables and classes pop up on ctrl+space).

I'd like autocompletion of Bootstrap classes to be available when editing *.html.erb files too (or any html file for that matter). Is that possible?

ps In *.html.erb files, the only css classes available for autocompletion are the ones directly defined in custom.css.scss.

6 comments

It's been more than a week since I posted that, yet no replies. Is that to say it's working for everyone else or is it no-one else is bothered? :)

0

Hi Nikos,

My apologize for delay. It's probably a bug. Could you please give an example of html.erb file?

0

Hi Alexander

Thanks for the reply. Attaching a screenshot of the suggestions I get on ctrl+space. As you can see, the only 2 classes available for autocomplete are center and debug_dump, which were defined in custom.css.scss.
This issue is driving me mad - please don't hesitate to ask for more information.



Attachment(s):
Screen Shot 2014-06-17 at 3.42.03 PM.png
0

Hi Nikos,

I've understood the problem. Unfortunately at the moment IDE can't provide properly completion for class names that defined in SASS/SCSS/LESS/Stylus. As a workaround you can place compiled bootstrap.css inside your project and IDE should provide completion from it.

The original bug is http://youtrack.jetbrains.com/issue/WEB-5879. Feel free to vote for it.

0

Hi Alexander

Thanks for the pointer. Checked and upvoted! I see this was reported 21 months ago. I'm sure you guys are very busy delivering new features, but IntelliJ is "with pleasure develop" and all these little annoyances take away from the pleasure bit. :)

Autocomplete suggestions work fine for bootstrap variables and classes from within custom.css.scss, so apparently you've done the hard part. Why not go the extra mile and make this information available to *.erb and *.html files in the same project?

0

It isn't very hard and I'll definitely fix it. But at the moment there are more important and more upvoted issues.

0

Please sign in to leave a comment.