英文:
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 'product.json#extensionEnabledApiProposals' extension 'github.vscode-pull-request-github' wants API proposal 'commentsResolvedState' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') 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 (<anonymous>)
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 (<anonymous>)
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 - @alexr00
> Note that this warning will not impact the functionality of this extension at all. - @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.
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论