microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.63k stars 29.04k forks source link

Setting `files.associations` is not observed/respected #138664

Open kanlukasz opened 2 years ago

kanlukasz commented 2 years ago

Does this issue occur when all extensions are disabled?: Yes - I test on fresh and clean portable installation

Version: 1.62.3
Commit: ccbaa2d27e38e5afa3e5c21c1c7bef4657064247
Date: 2021-11-17T08:11:14.551Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

Steps to Reproduce:

bug-lang12

IllusionMH commented 2 years ago

It looks like limitation related to plaintext in file association and Language Detection feature. See https://github.com/microsoft/vscode/issues/133506#issuecomment-931588566 and previous comments.

You can disable language detection with "workbench.editor.languageDetection": false but I don't think there are other workarounds ATM.

Setting something like

"files.associations": {
    "*.php": "plaintext",
    "*.js": "plaintext"
}

works as expected

/assign TylerLeonhardt