为什么 VS Code 将 .cs 文件视为纯文本,而其他一切正常?

Why is VS Code treating .cs files as plain text, but everything else normally?

我在 Visual Studio 代码中打开了一个 Unity 项目,其中包含 3 个 .csproj 文件、一个 launch.jsonsettings.json 文件。我正在使用 VS Code 的 VS Code plug-in for unity, and the Unity Tools 扩展。
如果我打开一个 .js 脚本,VS Code 会这样对待它,并且所有突出显示都会发生。但是,如果我打开一个 .cs 脚本,它会将其视为纯文本文档,并且我看不到任何格式或 IntelliSense。如果我尝试手动 select 语言,我可以 select 大多数我喜欢的语言,除了 C#,它不在列表中。

您可以手动安装 C# 支持。看起来它在代码的 February update 中是可选的。

键入 F1 以获取命令 window 并键入 ext install 以安装扩展。获取 C# 扩展并重新启动代码。

有关 C# 支持的详细信息,请参阅 documentation