RockBoro
RockBoro

Reputation: 2473

where does vscode store file association overrides?

Where does VSCODE store the overridden association of a specific file to a file type?

You can press CTRL K + M and associate a specific file in a project with a specific file type. That association does not apply to other files with the same extension. And does not apply to the same named file in another project.

Is this association stored in project folder somewhere? I do not see anything in the ./.vscode folder.

Upvotes: 0

Views: 1772

Answers (1)

Prashant Biradar
Prashant Biradar

Reputation: 323

VSCODE store association of specific file to file type in its own extension module. If you want to override then you need to add it in settings.json as per the specific file icon theme implementation.

Icon association depends on the file icon theme. I have tried with vscode icon theme.

  • Create folder vsicons-custom-icons under ./vscode directory.

  • Create svg icon under vsicons-custom-icons folder and follow naming convention:

    • For file: file_type_<value_of_icon_property>.svg
    • For folder: folder_type_<value_of_icon_property>.svg

    e.g. With the property value "icon": "mai" in settings.json the file name should be file_type_mai.svg or folder_type_mai.svg

  • Then modify settings.json file under ./vscode

    {
        "vsicons.customIconFolderPath": "./.vscode",
        "vsicons.associations.files": [
        { "icon": "mai", "extensions": ["abc.sql"], "filename": true, "format": "svg", "overrides": "abc.sql" }
    
        ]
    
    }
    

Upvotes: 3

Related Questions