Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode files.associations

I have some .txt files in a subfolder of my project which contain SQL code. I want SQL syntax highlighting so I added this to my workspace folder settings:

{
    "files.associations": {
        "**/somefolder/*.txt": "sql" 
    }
}

This works when there are the two stars in front of the folder name. But somefolder actually is a folder direct under my project's root.

Why can I not write the glob like somefolder/**/*.txt?

like image 912
Bernhard Döbler Avatar asked Apr 12 '18 20:04

Bernhard Döbler


People also ask

How do you link two files in VS Code?

Just use Ctrl and Shift to select multiple files and folders, then right-click and choose Combine Files. If you select a folder, all matching files in subfolders will also be included. The result will be a single file containing the content of all the selected files.

How do I organize my code in VS?

The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.


1 Answers

Seems like this new version of VSCode requires you to use the ** at the start regardless:

{
    "files.associations": {
        "**/somefolder/**/*.txt": "sql" 
    }
}

That should work

like image 100
Fabio Tani Avatar answered Sep 21 '22 06:09

Fabio Tani