How do I make vscode c++ intellisense work with remote development? - visual-studio-code

When running vscode locally on windows I can install the C/C++ extension and immediately have some code understanding from the editor (visual studio 2019 is installed too):
However after installing OpenSSH and connecting to the same PC via the vscode Remote Development extension (connecting from linux to Windows) this doesn't work:
Everything I hover over says: Unsupported Markup content received. Kind is:
Also typing msg.<ctrl+space> gives No suggestions.
The only references I can find are:
https://github.com/redhat-developer/vscode-xml/issues/43
https://github.com/TypeFox/monaco-languageclient/pull/103/files#diff-fde961a63820de2855135d552feaef126f4624fa959efbe848c112a5fb04e4a5R180
These don't seem related. I have not set up a c_cpp_properties.json but then I didn't need to for the local test that worked. The error makes me think there is some conflicting extension, but I've uninstalled most others and the issue persists. What have I missed?

Related

Build vscode server from vscode source code

I've been using gitpod's OpenVSCode Server recently, which is mostly based on VSCode. I looked at some of VSCode's documentation on Github, but I don't know how this is implemented. It seems that VSCode's official vscode server is not public. May I know how to package VSCode source code as vscode server?
I've tried many ways, but it doesn't work

Cannot find Arduino IDE path. In Visual Studio Code

I wants to use Arduino in vs code Visual Studio Code.
I installed arduino IDE on my local machine on C:\Program Files\Arduino IDE I also added arduino path my Visual Studio Code's setting .json
"arduino.path": "C:\\Program Files\\Arduino IDE",
setting .json
I am using arduino extension.
This is the pic of extension
Any suggestion or recommendations would greatly aid me. I've been struggling to find a solution for this problem for 6 hours.
This was giving me issues for the longest time, too. It seems that the Arduino 2.X IDE doesn't work well with VSCode.
To resolve, use the legacy IDE (Arduino 1.8.X). First, uninstall the 2.X version of Arduino. As of February 2023, you can download the legacy version by going to the Arduino Downloads page and scrolling down to the "Legacy IDE (1.8.X)" section. There's a few different download options. I opted for the one labeled "Windows Win 7 and Newer" since it's a neatly contained executable to install Arduino.
From here, run the executable and install normally. I also reinstalled the Arduino plugin in the Visual Studio marketplace (not sure if necessary, but it doesn't hurt). There's at least three places you could potentially enter the arduino.path:
The one in YOUR PROJECT FILEPATH/.vscode/settings.json
The one in the VS Code User Settings (File>Preferences>Settings> User tab> Search for arduino.path in the search bar)
Same as above, but on the "Workspace" tab instead of "User"
For me, leaving all three empty worked fine. I believe that's because the installer added Arduino to the Windows Path variable. Here's a related post, though, where someone had to configure the path variable in case that doesn't work for you.

WSL Distros not visible to VSCode or IntelliJ IDEs

For a few weeks now I have had this very strange issue and have been unable to resolve it:
I usually code on WSL2, and it used to work fine on this machine and user. But now, whenever I try to open the Remote Explorer in Visual Studio Code or try to open a "New Project from Existing Files" in an IntelliJ IDE, no WSL Distros show up.
They are still there - wsl -l -v lists them and I can open them in the terminal. Everything inside of them works (aside from opening VSCode).
In Windows Explorer, their filesystems do show up. But in Visual Studio Code the list of Distros is empty and I get an error message stating "Cannot read properties of undefined (reading 'name')" when I open the Remote Explorer. In IntelliJ IDEs, only my local drives appear where there used to be additional entries for WSL.
When I navigate to a directory in WSL in the terminal and then execute code ., it opens a VSCode window, but then I get the notification "No WSL distros found".
Interestingly, previously opened projects in IntelliJ IDEs can still be opened (but I am getting Line-Ending issues).
I have tried reinstalling the WSL extension in VSCode, restarting the LXSSManager-Service, doing a network reset with netsh winsock reset, netsh int ip reset, ipconfig /release, ipconfig /renew, ipconfig /flushdns - and I have tried reinstalling VSCode entirely... to no avail. I have also looked at the registry entries for the WSL Distros under Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\, and they look fine to me.
I have also uninstalled my non-primary distros and reinstalled them - same issue across all installed distros, old or freshly installed.
I am sadly unable to specify how to reproduce the issue as everything used to work in this setup and nothing was deliberately changed.
My Windows version is Windows 11 Version 22H2 (OS Build 22621.963).

Why cannot I use the Vim VSCode extension over ssh or wsl?

I cannot install the Vim VSCode extension on my headless machine through VSCode remote development nor in WSL. I think I used to be able to but I uninstalled it once and since then I haven't been able to install it again. I can only install and uninstall on my Windows computer but not remotely: when I click the button to install Windows extensions to server, the Vim VSCode extension is not part of the batch:
Edit: actually the extension stopped working in Windows as well without obvious reason.
Here is a list of my extensions: maybe I introduced incompatibilities I am not aware of:
I wonder how to get a JSON list of the extensions by the way :(
I might be wrong but I don't believe the normal VSCodeVim extension requires Vim itself to be installed as it just emulates it, so it shouldn't need installed in the remote environment as long as it is installed/enabled which it looks to be. Is it not working?
There was a bug in the settings JSON file. There was some syntax error, possibly caused by the installation of some other extension.

How to Access Linux Files in a WSL distro from Windows 10?

Recently I updated my Windows 10 Pro with May Update (version 1903, build 18362.116). Then for my existing distros: OpenSuse Leap 15 and Ubuntu (installed from MS Store), I wanted to open a linux directory by using Explorer and I'm getting this message:
[susedis#mypc ~]$ explorer.exe .
If 'explorer.exe' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf explorer.exe
This problem happens also with VSC (code) and VSC-Insiders (code-insiders).
I've read this article and ...
OPTION 1: my current problem
OPTION 2: icon LINUX does not exist in tree view
OPTION 3: it works
Supposedly options 1 and 2 should exist and work, even more with the latest update. What's wrong? Thanks in advance.
PS1: I've found these articles Run Visual Studio Code for Linux from WSL and Using Visual Studio Code with Windows Subsystem for Linux, they talk about installing xserver and more stuff on side linux. But many other articles and videos don't talk about it, it's like it was a built-in feature of Windows. This is so dark.
I just found what is the root of my problem: the distro.
explorer, code, code-insiders commands ONLY work through UBUNTU and I was using OpenSuse.
This warning is lacking in every article on Web I read, including on VSC site (example: Developing in WSL). This is a disadvantage for other distros. Very bad.
PS1: The solution can be found here.