Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get intellisense for content inside imported partials in VS Code?

I have a styles.scss and a partial that holds some color variables _colors.scss.

_colors.scss:

$primary: #009688;
$secondary: #4caf50;

styles.scss:

@import 'colors';

.blurred {
    color: $primary;
    filter: blur(2px);
}

This works, but I would like to be able to have intellisense for the $primary variable, just as if it was declared in styles.scss. Is there a feature/extension available for VS code that can do this?

like image 223
iuliu.net Avatar asked Oct 15 '16 14:10

iuliu.net


People also ask

How do I enable autocomplete in Visual Studio?

The suggestion list of Automatic completion appears as soon as you start typing a new identifier. The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space .

What is IntelliSense what are the option inside IntelliSense?

IntelliSense is a code-completion aid that includes a number of features: List Members, Parameter Info, Quick Info, and Complete Word. These features help you to learn more about the code you're using, keep track of the parameters you're typing, and add calls to properties and methods with only a few keystrokes.

How do I turn on IntelliSense?

You can enable or disable particular IntelliSense features in the Options dialog box, under Text Editor > C/C++ > Advanced. To configure IntelliSense for single files that aren't part of a project, look for the IntelliSense and browsing for non-project files section.


1 Answers

Install SCSS IntelliSense

https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss

enter image description here

Image source

There is no color preview though https://github.com/mrmlnc/vscode-scss/issues/13

because vscode doesn't support this yet and there is no plan to add it https://github.com/mrmlnc/vscode-scss/issues/29

like image 87
rofrol Avatar answered Oct 19 '22 21:10

rofrol