Live Server Extension in VS Code is not working in WSL - visual-studio-code

I have been working with visual studio a long of time ago in Windows without any problems.
I installed WSL in my PC, all perfect.
But now I migrated one of my webpages directory to the WSL root
\wsl$\Ubuntu\home\user\webPage
And when I click on "Live Server" extension, it loads propertly in:
http://127.0.0.1:5500/index.html
But when I make a change and save, is not working
Do I have to change something else? Of course all the extensions are installed, seems to be the same

Modify this settings in your VS Code extension:
"liveServer.settings.https": {
"passphrase": "true",
"key": "true",
"cert": "true",
"enable": 1
},

You have to install this extension Remote Developer Extenson Pack
Once you do this, open your Visual Studio normally and you will be able to develop, there are some extensions not compatible.
More references here
It is important to see in your VS code in the left-down side, that you are in WSL:Ubuntu in color green, You can also open in that sideWSL UBUNTU

I had the same issue, but when trying it on Windows, it was working correctly, so I guess that Live Server will try to load it as localhost (which is 127...) but WSL doesn't use that. This can be confirmed by running ifconfig on the WSL Terminal.
I found a setting on the extension called "Use local IP". Once checked, it will open the Window with the WSL address instead of localhost and changes are shown properly.

Related

Why are VSCode extensions not working in SSH

I am using the Remote-SSH extension. When I SSH to a local VM that has Linux, or far away to my uni's pc lab, all my VSCode local extensions don't work, it doesn't show under the extensions pane -> local installed. So doing the keyboard shortcut for one says "command 'extension.advancedNewFile' not found". Why is this and how do I fix this?
The first diagram in https://code.visualstudio.com/docs/remote/ssh shows it clearly that only theme/UI extensions remain applicable when VSCode is under remote development mode,
If you want features of certain extensions, you have to install them on the remote machine (under EXTENSIONS | SSH: MACHINE_NAME - INSTALLED).

Live Server does not open in Chrome on Windows 11 and WSL2

I am working in WSL2 on Windows 11 trying to run an index.js file with Live Server. Whenever I open Live Server it seems that I can only do so when I use Microsoft Edge. This seems to add another layer of problems because the JavaScript does not seem to be working as I would expect. For example, if I click a button element I don't see any animations to signify a "click".
I have checked that "liveServer.settings.CustomBrowser": "chrome" is indeed reflectin Chrome in the VS Code settings, but when this is the case there are no windows that pop up at all. The only thing that I see trigger is a notification that tells me that the server is active on Port 5000, just no window popping up to demonstrate that. Ideally I would like to try and open Live Server with Chrome, but if this isn't possible in Windows 11 then is there a way to make JavaScript behave in Microsoft Edge?
I've the same configuration and the same issue. I've raised the issue #2445 in Github.
A workaround solution is to call directly your chrome program installed under windows to your liveserver setting.
check that chrome is well installed on W10 or W11. You can test it by opening a command line and running "start chrome", then chrome browser must open.
look for chrome' installed directory. You can use this command to find it: sudo find /mnt/c/ -type f -iname chrome.exe 2>&1 | grep -v "Permission denied". For me this it's here:mnt/c/Program Files/Google/Chrome/Application.chrome.exe.
Now change liveserver setting on your settings.json file:
{
"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --remote-debugging-port=9222",
}
Now chrome should start when you run liverserver.
Hope this help

What is the install terminal and how to remove it from VS Code terminal window?

This started showing up a few months back in my VS Code setup. It wasn't bothering so much, so I kept ignoring it. I am not sure what it's called, but searching around with "install window" or other combinations for VS Code gives some unexpected results. I am using remote-ssh extension for development and believe that it has something to do with a remote extension setting. If I try to close this window, my ssh connection breaks and VS Code opens up another of these to recreate the ssh connection.
I have tried checking and unchecking various remote-ssh extensions but to no avail. Even reinstalling VS Code didn't do any good. I don't see the same behavior on other machines that I have VS Code installed.
I would really appreciate if someone could help me get rid of this terminal. My VS Code is running on macos and ssh server is Ubuntu if this helps.
Remove "remote.SSH.showLoginTerminal": true from your User settings JSON file, then exit VSCode and re-launch the workspace. If that doesn't work set the setting to false instead.

How do I make vscode c++ intellisense work with remote development?

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?

C/C++ Code navigation not working in vscode remote development

Tried to access a remote project (from Linux environment) over vscode remote development environment, followed all the necessary steps mentioned in https://code.visualstudio.com/docs/remote/remote-overview, Able to see the files and folder structure but unable to navigate the source code. Tried "Goto Definition"(F12) and Ctrl+ Click also not working
Tried to set max watch value to fs.inotify.max_user_watches=524288 still issue remain same
Once I reload the extensions it worked fine. I installed C/C++ IntelliSense from Microsoft and Austin