DEV Community

Cover image for FSCSS now has autocomplete, hover docs and linting, in VS Code and on your phone
FSCSS tutorial for FSCSS tutorial

Posted on Edited on

FSCSS now has autocomplete, hover docs and linting, in VS Code and on your phone

Hey everyone! ๐Ÿ‘‹

I've been working on FSCSS Extensions, Editor experience was basic: colors and snippets, and that was it.

So I spent some time fixing that. Both the VS Code extension and the Acode plugin (yes, you can write FSCSS on Android) now have real editor intelligence.

What's new

Autocomplete
Type @ and you get the at-rules, plus any @define blocks from your own file, with the parameters ready as tab stops. It also suggests array names after @arr., methods after @arr.name!., your $variables, built-in functions like num(), count(), etc, and the property shorthands.

Hover docs
Hover any FSCSS keyword or function and you get its signature and a short explanation. Your own symbols show their definition too.

fscss vscode syntax

Checks (linting)
The editor now underlines things like:

  • unclosed backticks, brackets and braces
  • @define parameters used without @use()
  • @arr, @fun, @event or $var! references that don't exist
  • chained array methods (FSCSS doesn't allow them)

FSCSS Acode syntax check

VS Code extras
Go to Definition (F12), signature help while typing arguments, an outline of your file, and a Quick Fix that wraps a parameter in @use() for you.

A tiny example

@define box(a: #454545, b){
  bg: @use(a);
  color: @use(b)
}

.box{
  @box(1, 2)
}
Enter fullscreen mode Exit fullscreen mode

Start typing @bo inside .box and the editor offers @box(a, b) with the parameters as tab stops.

Get it

Heads up

  • Checks for undefined names only look at the current file, so they're skipped when a file uses @import.
  • In Acode, turn on Live autocompletion in the editor settings to get suggestions as you type.

Your turn

If you try it, I'd love to hear what feels off or what's missing. Bug reports, ideas and PRs are all welcome on the repos above.

Thanks for reading, and happy styling! ๐ŸŽจ

Top comments (0)