VS Code无法识别文件扩展名。无法安装任何扩展。

huangapple go评论45阅读模式
英文:

VS Code does not recognize file extensions. Can't install any extensions

问题

我使用VS Code已经很长时间了,它一直都运行正常。但突然今天VS Code不再识别文件扩展名了。无论是.js还是.css,它都将它们标记为纯文本文件。

然后我发现我的所有扩展都不知何故不再安装了,当我尝试重新安装它们时,会出现错误:

2023-02-14 12:48:17.453 [info] Electron沙盒模式已启用!
2023-02-14 12:48:17.489 [warning] 通过'product.json#extensionEnabledApiProposals'扩展'github.vscode-pull-request-github'想要API提案'commentsResolvedState',但该提案不存在。很可能该提案已经最终确定(检查'vscode.d.ts')或已被放弃。
2023-02-14 12:48:18.714 [error] 扫描已安装扩展时出现错误:
2023-02-14 12:48:18.715 [error] SyntaxError:意外的JSON输入结束
    在JSON.parse(<anonymous>)
    在Object.factory(vscode-file://vscode-app/c:/Users/kilia/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:741:99212)
2023-02-14 12:48:19.980 [error] SyntaxError:意外的JSON输入结束
    在JSON.parse(<anonymous>)
    在Object.factory(vscode-file://vscode-app/c:/Users/kilia/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)
...

我尝试删除C:\Users\kilia\.vscode\extensions中的所有扩展文件夹,然后在删除后尝试重新安装,但没有成功。

英文:

I have used VS Code for a long time and it always worked fine. Suddenly today vs code does not recognize file extensions. Whether .js or .css it marks them always as plain text file.

Then I saw that all my extensions somehow are not installed anymore and when I try to install them again, it gives an error:

2023-02-14 12:48:17.453 [info] Electron sandbox mode is enabled!
2023-02-14 12:48:17.489 [warning] Via &#39;product.json#extensionEnabledApiProposals&#39; extension &#39;github.vscode-pull-request-github&#39; wants API proposal &#39;commentsResolvedState&#39; but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check &#39;vscode.d.ts&#39;) or was abandoned.
2023-02-14 12:48:18.714 [error] Error scanning installed extensions:
2023-02-14 12:48:18.715 [error] SyntaxError: Unexpected end of JSON input
    at JSON.parse (&lt;anonymous&gt;)
    at Object.factory (vscode-file://vscode-app/c:/Users/kilia/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:741:99212)
2023-02-14 12:48:19.980 [error] SyntaxError: Unexpected end of JSON input
    at JSON.parse (&lt;anonymous&gt;)
    at Object.factory (vscode-file://vscode-app/c:/Users/kilia/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)
...

I tried to remove all extensions folders from C:\Users\kilia\.vscode\extensions and install it after removing, but it did not work.

答案1

得分: 2

这个问题已经在 GitHub 上报告,修复已经验证。

我假设你正在使用 VS Code v1.75.1(在撰写本文时的最新版本)。

microsoft/vscode-pull-request-github 仓库中查看此问题:Unknown error message help -extension 'github.vscode-pull-request-github' wants API proposal 'commentsResolvedState' but that proposal DOES NOT EXIST #4518

发现了 GitHub 拉取请求扩展的问题。修复将在下一个 VS Code 内部版本中提供。不幸的是,我不能只是更新扩展来解决这个问题在稳定版本中的问题。 - @alexr00

请注意,此警告不会影响此扩展的功能。 - @alexr00

我假设他们所指的问题是这个:在更新 vscode insiders 后,出现 wants API proposal 'commentsResolvedState' 与 Github 扩展 #4425

该帖中的其他人也经历了由于此问题而无法安装扩展的副作用

英文:

This issue has been reported on GitHub and a fix has been verified.

I'm assuming you're on VS Code v1.75.1 (the latest version at the time of this writing).

See this issue in the microsoft/vscode-pull-request-github repo: Unknown error message help -extension 'github.vscode-pull-request-github' wants API proposal 'commentsResolvedState' but that proposal DOES NOT EXIST #4518

> Found the issue for the GitHub Pull Requests extension. The fix will be available in the next VS Code insiders build. Unfortunately, I can't just update the extension to resolve this issue in the stable build -&nbsp;@alexr00

> Note that this warning will not impact the functionality of this extension at all. -&nbsp;@alexr00

I'm assuming the issue they're referring to is this one: After updating vscode insiders, getting wants API proposal 'commentsResolvedState' with Github Extension #4425.

Other people in that thread also experience the side effect of not being able to install extensions due to this.

答案2

得分: 0

我已经能够通过使用vsCode的内部构建版本来临时修复。
VScode Insider下载页面。这个测试版已经有了修复,并且现在可以正常工作。一旦他们更新正常版本,您可以切换回去。安装后,您可以使用code-insiders .来运行目录的内部构建并安装任何扩展。
1: https://code.visualstudio.com/insiders/

英文:

I was able to temporarily fix by using the insider build of vsCode
VScode Insider download page. This beta version already has the fix and works fine now. Once they update the normal version you can go back. Once installed you can use code-insiders . To run the insider build for a directory and install any extensions.

huangapple
  • 本文由 发表于 2023年2月14日 19:57:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75447496.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定