简体   繁体   中英

Visual Studio Code syntax highlighting is not working for JavaScript and TypeScript

This suddenly happened after I created a new file while working on a project. Almost all characters are simply white text (except for brackets, because I have bracket pair colorization enabled)

第一张图片显示了 JavaScript 和 TypeScript 语法高亮显示如何不起作用

第二张图片显示了 JavaScript 和 TypeScript 语法高亮显示如何不起作用

第三张图片显示了 JavaScript 和 TypeScript 语法高亮显示如何不起作用

I already tried resetting my configurations, checked my configurations (both globally and in my workspace), and tried this extension that offers an alternative syntax highlighting (which worked, but I would prefer using the Visual Studio Code one).

I think this was caused by the extension called JavaScript and TypeScript Nightly. This was causing the syntax highlighting for .js and .ts files ( .jsx and .tsx too). This was more of a bug with the latest version (currently 1.73.1).

You can disable the extension to enable the syntax highlighting.

JavaScript 和 TypeScript 每晚


This extension has now been updated and this issue is fixed.

What user Haneen said was correct, but instead of disabling it, you can install an old version that works just fine.

Click the cog on the bottom right → 'Install Another Version' → select an older version.

Cog at bottom right

Yes, this is exactly caused by the JavaScript and TypeScript Nightly extension.

You can disable or install another version (I recommend installing the prior version since the current version has a bug).

在此处输入图像描述

I am currently using the version which was released 2022-11-13.

在此处输入图像描述

The current version ( v5.0.20221116 ) for JavaScript and TypeScript Nightly seems to be breaking the syntax highlighting. Downgrading to a previous version might resolve this issue.

在此处输入图像描述

This was resolved in v5.0.20221117 however.

Also, I deleted this JavaScript and TypeScript Nightly package, and now it works fine for me.

The module on the marketplace: JavaScript and TypeScript Nightly

I think this was caused by the extension called JavaScript and TypeScript Nightly. This was causing the syntax highlighting for.js and.ts files This was more of a bug with the latest version

As others mentioned, the two latest versions are causing issue for me, but 5.20221115 is working for me.

It was fixed with the latest update of JavaScript and TypeScript Nightly .

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM