Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable IntelliSense for Sass in .vue files in VS Code

Is there a way to enable IntelliSense for Sass in .vue files without associating them with sass for it would break off another extensions relying on .vue file association?

like image 488
Max Avatar asked May 08 '17 18:05

Max


People also ask

How do I enable IntelliSense in VS Code?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript).

Why is IntelliSense not working in VS Code?

If the IntelliSense is installed and still not working then most of the time restarting/reloading the program will solve the issue. So give it a try. Step 1: To restart VS Code open VS Code and press Ctrl + Shift + P keys together to open the command palette and type Reload Window in the search.

Does VS Code have IntelliSense?

IntelliSense options are on by default.


1 Answers

To get sass or scss syntax highlighting you need to have the Vetur (octref.vetur) extension installed in VS Code. I have experienced issues with Vetur that the vue-language-server fails to start, which causes alot of issues with syntax highlighting. I have not found a fix for this except a re-install. Also make sure to run the latest version of VS Code.

In a .vue file, you also need to ensure you use the correct attributes

<style lang="sass">
    .my-class
        text-align: center
</style>

Or for scss

<style lang="scss">
    .my-class {
        text-align: center
    }
</style>
like image 142
Benjamin Avatar answered Oct 10 '22 17:10

Benjamin