Fastest Way To Open HTML File in Browser using VScode - Current Extensions Failing - visual-studio-code

I want to be able to quickly open my html files from VScode to Chrome.
I have been using the extension Open in Browser, but not it appears to be failing.
I've tried this extension alternative, but it doesn't work on my rig either.
As a workaround I am currently searching for the file in finder and dragging it to chrome.
Any suggestions to streamline this process or alternative extensions to open html files in browser?
Rig Details: 2014 Macbook Air Running Mojave 10.14.1

Works for a bunch of extensions:
https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-open-in-application
Example of config for Windows:
"openInApplication.applications": {
"html": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
}

Related

Unable to open http links from Visual Studio Code: Your Firefox profile cannot be loaded

When I try to open a http-Link in Visual Studio Code, my standard browser Firefox is not able to open it. I receive a Firefox error message:
Your Firefox profile cannot be loaded. It may be missing or inaccessible.
How I reproduce this on my machine:
Create a document (test.txt), paste http://www.stackoverflow.com/ in it, hover over the link in VS Code and follow it via ctrl-click.
I am not sure if this a Firefox question or a VS Code question, or both. But opening links from other programs such as Thunderbird or LibreOffice Writer works.
If I go to ~/.mozilla/.firefox/ and delete the profiles.ini, Firefox creates a new profiles.ini with which links do open from VS Code. However, that way I lose my Firefox profile.
Versions:
Ubuntu 20.04 LTS
VS Code 1.68.1
Firefox 101.0.1
The problem was that Visual Studio Code always tried to open a different, non-existing profile than the one that Firefox uses. My profiles.ini in ~/.mozilla/ was not correctly configured. There was an entry
[Profile1]
Name=default
IsRelative=1
Path=ezn6ueee.default
Default=1
set as default which was pointing to a folder ezn6ueee.default which did not exist in the directory. I went in Firefox to about:profiles, deleted this profile and set the one which I was usually using as default.

Visual Studio Code Love2D support extension detecting love.app as a directory

I have just started with löve because of an internet course I'm on, and I'm using Visual studio code as my editor. The course recommends that I use the "Love2D Support" extension with Visual Studio. It allows me to run the code directly from VS by pressing Command + L.
Although when I do it, VS outputs me this error:
The setting specified in pixelbyte.love2d.path must be an executable file, not a directory. Check your settings.
The path I have input in the settings is /Users/My_Username/Desktop/love.app
I am 100% sure that it is the correct directory. What is the problem?
Thanks for answering!
The actual executable file in Mac is /Applications/love.app/Contents/MacOS/love so put this in your pixelbyte.love2d.path command in vscode and you are good to go.

How to open a file in vscode under wsl using the vscode:// url?

I would like to open a file in vscode under WSL (Windows Subsystem Linux) using the vscode:// url.
You can do it with a normal file in the usual filesystem vscode://file/c:/myProject/package.json
It is clearly explained in the documentation
I would like to open a file which is located in WSL, so to have something like this
vscode://file/home/user/myProject/package.json
But It does not work !
It does not work to use the complete path in windows as it does not start the WSL vscode
vscode://file/C:\Users\john\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gqsdeaz4\LocalState\rootfs/home/user/myProject/package.json
You can use the following scheme vscode://file//wsl$/Ubuntu-18.04
In your case it will be vscode://file//wsl$/Ubuntu-18.04/home/user/myProject/package.json
But unfortunately file is opened in a new window.
Please see https://github.com/microsoft/vscode/issues/99691
To open a remote window, don't use file but vscode-remote.
Please try vscode://vscode-remote/wsl+distro+name/path/to/file
Source: Opening VS Code with URLs doesn't work with \wsl$ urls

run file in browser from vscode

just installed vscode and I'm missing a trick which I think should be obvious but I just can't seem to find the answer.
I run apache as my local test server. When I'm in vscode and have a root folder open I would like to be able to send any file I'm editing to my browser and use the root folder name + relative path to file in the url sent to browser.
so what I actually want to send to browser is full url :
http://localhost/current-root-folder-in-vscode/relative-path-to-file
the file could be the open open one or one listed in vscode explorer which is not open.
suggestions much apprceiated.
p.s. I have searched possible vscode extensions and haven't found anything that seems to do it.
Fixed. I edited View-In-Browser extension locally to make it work the way I want.

Visual Studio Code on Mac

I installed Visual Studio Code on Mac/OSX (drop app in Applications)
- uninstalled (moved the App to the Trash)
- installed again
Since the second time I installed I didn't get the same start screen as during my first install I suppose somewhere in my file system Visual Studio Code writes something?
I would like to know where (besides in the Application folder) Visual Studio Code writes files?
VSCode uses another folder to store settings, including a flag to indicate if welcome should show or not. The folder is:
Windows: %APPDATA%\Code
Mac: $HOME/Library/Application Support/Code
Linux: $HOME/.config/Code
I've looked on my wife's mac and can't find a trace of these settings, they're not in any standard folder ($HOME, /Libraries/Preferences, /System/Libraries/Preferences nor /Libraries/Containers).
But to open the original start screen, you can use Help -> Show Welcome.
The settings are stored though, if you run "defaults read" you will see a number of settings related to vscode mentioned, including the files you had open last time you closed. Since Visual Studio Code uses the GitHub Atom Shell under the hood, you need to read the settings for atom using
defaults find atom
which will show you some data stored for the app.