I started to use Bracket as my IDE. I like it...
When I edit a CSS file there is great auto-complete, but when I edit less file there is no CSS auto-complete and it would be very useful.
Is there a way to turn CSS auto-complete for less files?
I started to use Bracket as my IDE. I like it...
When I edit a CSS file there is great auto-complete, but when I edit less file there is no CSS auto-complete and it would be very useful.
Is there a way to turn CSS auto-complete for less files?
For some reason there isn't any built-in support for this yet but it can easily be hacked in and works quite well.
Open C:\Program Files (x86)\Brackets Sprint 32\www\language\languages.json (or whatever path you have it installed to) and scroll down to the CSS
-key. Then just add "less" to the fileExtensions
-array, save it and reload Brackets.
"css": {
"name": "CSS",
"mode": "css",
"fileExtensions": ["css", "less"],
"blockComment": ["/*", "*/"]
}
For some reason this isn't enabled by default but I haven't discovered any problems with it this far. Works fine with nested declarations which I initially thought would be a problem.
Updated answer:
Autocomplete in LESS files is now enabled automatically in Brackets Sprint 36 and newer (along with the Quick Docs command). The workaround in the answer above is no longer needed.
Original answer:
There's not a way to do it yet. Brackets has a public backlog, which includes a user story for LESS code hinting support. You can upvote the user story if you sign in with a (free) Trello account.
Brackets recently added support for CSS-like code hinting in SCSS files, but that was much easier to do. Because the SCSS tokenizer in CodeMirror shares code the CSS one, the two produce very similar streams of tokens, allowing much of Brackets' existing CSS-analysis logic to be reused. The LESS tokenizer, on the other hand, produces different token information that would require larger code changes to support.
But it's certainly doable -- just a matter of prioritization. That's where backlog upvoting and/or pull requests come in :-)