visual-studio-codegatsby

Visual Studio Code doesn't recognize file types in directory named "templates"


I'm working on a Gatsby project with Microsoft Visual Studio Code as the code editor.

The project structure is as shown below:

.vscode
node_modules
public
src
  - components
  - pages
  - templates
    - blog.js
    - blog.module.scss
.gitignore
package.json

// ...

For all the files inside the "template" [src/templates] directory, VSCode doesn't recognize the file types & are being set to "Plain Text" by default.

Solutions tried with no success:

Details

VSCode Version: 1.44.2

OS: Microsoft Windows 10

How can I solve this?


Solution

  • There was an extension which was used for Emmet Abbreviations in Django HTML Templates. The extension changed the file associations for all the files inside the Templates folder to Django HTML and hence, all other files were being detected as plain text.

    Clearing out the Django HTML file association from settings.json fixed the issue.