Is there a way to retrieve user settings from a corrupt VS Code? - visual-studio-code

I have Visual Studio Code 1.27.2 on Windows 10.
Background:
Recently there was an issue in the system not related to VS, and I had to run system repair which seems to have messed up with the settings of various programs, including VS.
Current situation:
Now when I open VS I get this:
title bar of VS with 'Unsupported' at the end
warning: "Your Code installation appears to be corrupt. Please reinstall."
According to the official FAQ, this can be due to fishy extensions. But this seems unlikely given that the last extension I installed was more than a week before this incident, and more importantly because of the system-wide settings shake-up.
Main issue:
When I try to access settings directly, I get another strange error:
warning: "Unable to open 'User Settings': e.replace is not a function (2 errors in total)."
This function didn't look familiar so I looked it up and it was in the doxygen code, which has not changed for weeks, so also don't think this is the real issue.
I tried the suggestions here but there was nothing found in my folders.
I plan on re-installing in all cases. It's not the end of the world if the settings are gone, but it would be great to ensure they are saved because I spent a lot of trial and error customizing them.

Related

SignatureIntegrityCheckFailed error when downloading VS Code extensions

I just formatted my computer and installed VS Code, but when I went to download some extension, an error appeared and asked to check the "log", and then an error appeared in the console.
image of the error that appears in the console
I tried searching the program files but found nothing.
2023-02-08 19:01:39.542 [error] SignatureIntegrityCheckFailed:
Signature: SignatureIntegrityCheckFailed
at yt.download (vscode-file://vscode-app/c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:62:17985)
at async $.h (vscode-file://vscode-app/c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:90:171351)
Just a workaround. There is an issue raised but long inactive issue
Try this, this worked for me after all the other struggle with this bug.
"Programs\Microsoft VS Code\Code.exe" --ignore-certificate-errors
The security part of this is that, your trust store or at least the one VS code is using is not able to verify the authenticity. So be mindful of the risk involved.
So basically, we are working around this.

esp-idf build fails with "fatal error: esp_wifi.h: No such file or directory"

I am a student who has gotten a part time job embedded system programming. I am given a program the company uses, and asked to understand it. This is a working program. Therefore, the project can be built and flashed on ESP32 by the developers with no problem. So, the code and CMake files should have no issues. However, I cannot build the program either with VSCode extension nor with idf.py. In fact, I cannot build esp-idf examples from the official website, either.
Note: I am new to StackOverflow as well as to ESP32, so sorry if I made any mistakes here. If this post is problematic in any way, please inform me.
The error message from the terminal is shown here
I was initially using VSCode on Windows 10 (Windows is not activated). At first, ESP extension was completely failing to start the building process because it could not locate the tools. I was getting "could not be located" errors for all the tools. Below is a list of what I did in this setting:
I had v5.0.0 for esp-idf downloaded from Espressif server. I deleted it and tried v4.3.3 and then I tried to download from Github server. I downloaded the requirements for idf.py scripting environment and completed the settings for it as described by the Espressif's documentation.
I manually set the environment variables for IDF_PATH and PATH for both the user and for the system.
After 2, the initial error was gone. Unfortunately, I had a new error which indicated that ".elf" file for the project output could not be found. I do not exactly recall the error but if it is integral to the problem's solution I can try to replicate this issue.
I tried to delete and reinstall VSCode. I tried running VSCode with admin authority.
I tried changing the IDF_TOOLS_PATH in the VSCode esp-idf extension configurations from ".espressif" to "esp\esp-idf".
At this point, I moved to try to build the project on Ubuntu 22.04.1 LTS:
In Ubuntu, I got the fatal error: esp_event.h: No such file or directory error.
It does not seem to be a common issue and I could not find much about it online.
I followed the Linux setup steps in the documentation. It said that only step 1 (Downloading the prerequisites) was necessary for the VSCode extension.
I decided to try the "master branch" from esp-idf configurations as well. After I downloaded the master branch, the error changed to the current version: 'fatal error: esp_wifi.h: No such file or directory'
I also tried the idf.py in Ubuntu but I got the same error.
Both in Ubuntu and in Windows, the Doctor Command returns nothing. It does not even open the terminal or any window. I am not sure what it should return but some online discussions were asking about its return so I wanted to note it here.
Edit: When I tried the examples on Ubuntu, they actually build just fine. Doctor Command also works with examples.
However, the main code has still issues. Initially, I assumed I made some mistakes with esp-idf configurations. But, perhaps that was not the case.
I had the same problem and ended up editing my project's CMakeLists.txt. When I added "esp_wifi" to the "REQUIRES" list, it worked for me:
idf_component_register(
SRCS "main.c"
INCLUDE_DIRS res
EMBED_FILES res/settings.html
REQUIRES esp_wifi
)

A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found

I tried internet search on this issue and it is very common with many suggestions. The problem started with an update to VS2019 in which I paused because my projects in VSCode were breaking.I did a system restore and when I tried to start VSCode I got a message saying my installation was corrupt. So I reinstalled to the latest version and now get this error.
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found...
I found 3 extensions that needed updating so I do so but did not fix this problem. Do not know if I need to update the .Net Core since it looks like a version mismatch. It seems these updates are wreckless since they always cause thing to go wrong.s
If you are facing this problem, it means you are using Windows.
This official microsoft live share github page explains how to fix the issue: https://github.com/MicrosoftDocs/live-share/issues/102
Especially, check out this comment: https://github.com/MicrosoftDocs/live-share/issues/102#issuecomment-366509735
make vscode is up to date
uninstall live share from vscode
close vscode completely
restart vscode as administrator
reinstall live share
I should add:
close completely vscode and restart it

Duplicate hints while typing expression in Visual Studio Code

Why do I have the same suggestions while typing expression?
Example:
I had exactly the same problem. After a week or so, it get really annoying.
basically, as the comments hint to, there are probably multiple linting or intelisense tools. In my case (for python) i had the pylance extension added.
When i disabled this, the problem went away, but features were missing. So i added it back...
For some reason (i dont know why), this fixed the problem !!!
I can only hypothesise that in some way the extension was corrupted. Nevertheless, it worked.
EDIT:
I can also confirm that unchecking this setting appears to work:
Jupyter: Pylance Handles Notebooks
My current system is Windows 11, with python 3.10.
Final edit (8 Dec 2022):
This is resolved here:
Please could you install VS Code 1.74 and the latest Jupyter, PyLance and Python extension and confirm this still exists.
Visual Studio Code provides an API so third-party extensions and built-in modules can contribute suggestions for auto-completion pop-ups. The system is currently designed so suggestions are merely appended—there's no duplicate detection or removal (perhaps because extensions can also take care of sorting suggestions and such algorithm would get on the way). That means that if you have more than one extension or module for a given language you can easily get duplicate entries.
Having several extensions for PHP is not necessarily a bad idea since they can address different needs (for instance, PHP DocBlocker just creates annotations, it doesn't provide auto-completion suggestions) but you have at least two extensions (PHP Intelephense and PHP Intellisense) that do exactly the same things. That's likely to hurt performance (all your workspace files will be scanned several times) and just adds noise.
I suggest you read the extension descriptions carefully to learn what they do exactly and then figure out which ones you need. Remember that extensions can be enabled/disabled in a per-workspace basis.
The following is just my own totally subjective opinion. Among the PHP extensions that provide code intelligence only two of them seem mature enough:
PHP Intelephense
PHP Intellisense
I've tried both. PHP Intelephense works best for me than PHP Intellisense so that's the one I've kept. I've also disabled php.suggest.basic following the installation instructions because basic suggestions didn't add any value to me (they were blind string matching):
Turn off the php.suggest.basic setting for best results.
... as well as taming builtin Emmet support, which was providing really dumb suggestions:
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly"
YMMV.
TLDR; Installing pre-release version of Jupyter solves (v2022.11...)
Ok, so after some more extensive experimentation I think I found what's causing this in my case. After looking at the processes I noticed that there were two Pylance processes running, and consistently this would only be a problem if I was working in a session with a jupyter notebook open or one that had been opened.
saun89 17740 37.3 0.3 1008004 199492 ? Sl 20:58 0:22 /home/saun89/.vscode-server-insiders/bin/fef85ea792f6627c83024d1df726ca729d8c9cb3/node /home/saun89/.vscode-server-insiders/extensions/ms-python.vscode-pylance-2022.11.32/dist/server.bundle.js --cancellationReceive=file:9178e897a2b78b36bfd167f79b36c3bdad2931d71b --node-ipc --clientProcessId=17651
saun89 18743 257 0.7 1304584 382288 ? Sl 20:59 0:20 /home/saun89/.vscode-server-insiders/bin/fef85ea792f6627c83024d1df726ca729d8c9cb3/node /home/saun89/.vscode-server-insiders/extensions/ms-python.vscode-pylance-2022.11.32/dist/server.bundle.js --cancellationReceive=file:8744a321767eed92821fd737be4dc7dcfb728284e5 --node-ipc --clientProcessId=17651
Pylance basically spins up a service for the workspace, and then spins up a separate service for the notebook.
Output from "Python Language Server" logs:
Disabling Jupyter removes the duplication, and after installing an earlier version of the extension (v2022.4) this appears to have fully resolved the issue. I'm going to go ahead and log the extension bug once I have something reproducible.
As of 11/30/22, Jupyter Extension Pre-Release version v2022.11.1003281132 is the latest version fixes this issue. Click the gear icon next to the extension and you should see "install another version..." Then you can select version v2022.11.1003281132.

Runtime Error in Visual Simulation Environment - Microsoft Robotics Studio

I am using Microsoft Robotics Studio for a school project and I am getting a strange error when I try to run the Visual Simulation Environment. It was working fine until yesterday and then suddenly it gave me a runtime error saying "Illegal command line arguments... do not use VPLHost directly, use dsshost instead to run a manifest" But I am only clicking on Run in VPL/DSS Manifest editor.
I am running MRDS as administrator and I even tried re-installing MRDS but it is still showing the same MS VPL Runtime error. I tried to search online, but cannot find any suitable solution.
I already tried running the existing samples, I.e. Urban Environment, Multiple Simulated Robots etc. but it still gives me the same error. The strange thing is that it was working perfectly one minute, and then started giving me this error message the next minute, when I had not changed anything in between. In fact, I had wanted to change something in my manifest, so I closed the running VPL application, closed VPL and opened DSS manifest editor, and ran my manifest and that is when I got this error.
What is going wrong? Is some MRDS script using vplhost32.exe instead of dsshost? If so, then where and how do I change it?
I tried running the urban envrionment manifest from the command prompt and Using DSSHost32 directly. This time, it didn't give me a runtime error but an intiialization error. I tried changing port numbers but it still doesn't work. I have deleted many files from my computer to free space (JIC) and it still doesn't work. The window just doesn't open even when I hover over it in Windows 7.
The error message looks like this: Only one usage of each socket address (protocol/network address/port) is normally permitted."
This was even after I checked netstat for free ports and tried but I get this error message. Its either this one or the "Don't use VPLHost directly" if I run it through VPL or DSS Manifest Editor.
Could it be that some external services are interfering with DSSHost/VPLHost? Are there any such services which I could try killing? ANY help/suggestion would help right now as my project is due Thursday and this is a really unfortunate time for it to be acting up like this.
Does the problem reproduce after logging off & logging back on? It's likely that you had a process hanging around that you weren't aware of. Logging off should shut down any processes you personally started.
I don't know the solution of your problem, but it would be better that you post your question on the link below:
http://p2p.wrox.com/book-professional-microsoft-robotics-studio-isbn-978-0-470-14107-6-410/
[official forum for the book : Professional Microsoft Robotics Studio], i hope you will shortly get reply there,
The other option is to post your question on the msdn forum,
http://social.msdn.microsoft.com/Forums/en-US/category/robotics
hope this would help....