When I create a .ts file in a project, VS Code interprets it as "plain text". When I try to "Configure File Association for .ts", there are a few dozen languages to choose from but TypeScript is not one of them. Adding the following in settings.json doesn't seem to do anything:
"files.associations": { ".ts": "typescript" }
I have disabled extensions and commented out everything else in settings.json. I must be missing something obvious.
Note: fixed the issue by completely uninstalling and reinstalling VS Code.
Try running the following command in the visual code terminal
npm install -g typescript
I might be off-base, but does "files.associations": { "*.ts": "typescript" }
help? Note the asterisk.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.