how to add Intellisense to Visual Studio Code for bootstrap

Visual Studio-Code

Visual Studio-Code Problem Overview


I'd like to have intellisense for bootstrap specifically but even for the css styles I write in my project. I've got references in a project.json and a bower.json but they do not seem to be making the references available.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

You can install HTML CSS Support Extension.

ext install vscode-html-css

This will add Intellisense in your HTML files:

Bootstrap Intellisense

You don't need to configure anything for local files, just close and reopen vscode after installing. For remote css files, you can add the following

"css.remoteStyleSheets": [
  "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"
]

in the settings.json

Solution 2 - Visual Studio-Code

Here is the common steps (not only for Bootstrap) to enable css IntelliSense in VS Code:

Step 1: Go to https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion

or https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion

(Installation steps are already there)

Step 2: Click Install button that appear on the top of the website (screenshot below)

enter image description here

Step 3: After click, browser will show a pop-up window to access VS Code. Open it with VS Code.

Step 4: Click again the "install" button that appear inside the VS Code.

Step 5: After restarting the software, click the bottom left icon shown in the below image:

enter image description here

Step 6: Press "ctrl+[space]" inside the class quotes, you will get the complete class names from the attached stylesheets.

Solution 3 - Visual Studio-Code

In the latest version of VS Code the IntelliSense in comments and strings have been disabled by default. Below are the two options to bring back "24/7 IntelliSense" functionality or customize it to your own liking.

First make sure you have installed the HTML CSS Support Extension mentioned by dwonisch above.

Control + ',' to go to settings or click File -> Preferences -> Settings.

Click workspace settings tab and enter the following JSON code:

{
    "editor.quickSuggestions": {
        "comments": false, // <- no 24x7 IntelliSense in comments
        "strings": true, // but in strings and the other parts of source files
        "other": true
    }
}

The other option is to hit ctrl + space within the CSS quotes to activate the intelliSense. Example:

<div class="(ctrl+space)"> </div>

Solution 4 - Visual Studio-Code

enter image description here

just add this 2 packeges and you are done.. !!!

Solution 5 - Visual Studio-Code

Just install this extension in VS Code. IntelliSense for CSS class names in HTML

enter image description here

Solution 6 - Visual Studio-Code

Unfortunately, this feature is not currently available in VS Code. However, it has been added as a feature request for upcoming updates. You can track the issue on Github.

Solution 7 - Visual Studio-Code

  1. Open Visual Studio Code.
  2. Use CTRL+, to get to the Workspace Settings
  3. At your Right side window you will see something like this: enter image description here
  4. Another words paste this URL
{
  "folders": [
    {
      "path": "D:\\Visual Studio\\AndreyCourse\\the-complete-web-developer-in-2018\\DocumentObjectModel"
    }
  ],
  "settings": {
    "css.remoteStyleSheets": [
      "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"
    ]
  }
}
  1. Enjoy The Bootstrap Intellisense :-)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHonorable ChowView Question on Stackoverflow
Solution 1 - Visual Studio-CodedwonischView Answer on Stackoverflow
Solution 2 - Visual Studio-CodevishnuView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeJason HansonView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeHitesh PrajapatiView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeSayanthan MahendranView Answer on Stackoverflow
Solution 6 - Visual Studio-CodehxlntView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeDmitryView Answer on Stackoverflow