VSCode plugin VSCode-PHP-Format not working - visual-studio-code

I start using vscode less than a month. Please forgive me if this is a dump question.
OS: OS X 10.11.3
VSCode: 0.10.6
Plugin: VSCode-PHP-Format (download via git clone)
Extension path: ~/.vscode/extensions/VSCode-PHP-Format
I restarted VSCode, open php files, but do not see "Format Code" on the right click menu.
Any idea how to debug this? Right now I don't even know if the plugin load correctly.

With tips from Tobiah Zarlez, I found the "Toggle Developer Tools" in VSCode.
It is shown in the console the plugin cannot find js-beautify.
Solution
Inside ~/.vscode/extensions/VSCode-PHP-Format, run
npm install
It will pull in js-beautify. Then restart VSCode.

I am on my phone and not able to double check to see if it is there, but I'd recommend installing from the visual studio marketplace to insure the plug in is installed correctly. You can do so by hitting CTRL+SHIFT+P and typing "install extension"
Beyond that, a quick glance at the code the plug in should be activated when you open a php file... but since this is a third party plugin, I can't speak to if it actually works or not.
(Again, on phone so can't test)
What you could do is modify the extension.js file to add a "console.log ("hello world")" to the activate function. Them check the log to see if the plug in is installed correctly.
I saw you weren't the only person to complain about the plug in not working though. If I were you, I would continue to try and contact the creator

Related

Issue with VSC build (CMD-Shift-B) command on mac

I am working through the instructions on building VSC for developers (https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run) currently. Right under "Build" it instructs me to go "Go into vscode and start the build task with CMD+Shift+B) since I have a mac. I have gone into the folder in my finder and have pressed this combination of buttons but nothing happens at all. Am I supposed to do this in the terminal or am I missing anything?
It looks like the vscode directory must be opened in Visual Studio Code and a build is performed with ⌘ Command+Shift+B.
Here is an older version of the instructions where it is clearer:
https://github.com/microsoft/vscode-wiki/blob/2e2d6b0/How-to-Contribute.md#build
It appears that the directory vscode got mixed up with the full application name in a subsequent edit.

How to update VS Code on Windows?

I have VS Code version 1.37.1 and I want to update to the current available version 1.43. My OS is Windows 10.
How can I update the current version to the latest?. Like in Eclipse, check for updates is not updating the installation, rather it gives me a zip.
VS Code will automatically update itself on windows 10. If you'd like to force an update check there's an option available for that under 'Help > Check for Updates'.
If the update still doesn't complete, you can run the installer from here as described in the official Visual Studio Code Documentation under Docs » Supporting » Howtoupdate, found here.
If Update:Mode in VS Code's setting is on 'none' , 'Check for Updates ...' option will disappear from Help. Just be sure it's not on 'none' then you can check for updates.
2021-12-15, if you don't see Check for Updates... then Settings
Make sure it's not none
Then Help, Check for updates..., it won't auto-install. Once it downloads the update, either Help, Install update, or
Normally you don't need to do anything. The default configuration auto-updates and tells you it needs a restart.
If you experience different behaviour then either someone has interfered with settings in VS Code or the platform (Win/Lin/Osx) is misconfigured.
Type Ctrl+, or your platform equivalent and then filter for "update", then inspect your settings to see what may be mucked up. You can also force an update in the Help menu, and if this results in the download of a zip file it's not VS Code that's messed up, it's your platform.
Running this from the command prompt seemed to work for me:
winget upgrade --id Microsoft.VisualStudioCode
I think because I was running vscode as administrator I did not see the Help->Check for updates menu item.
My problem was that I had VS Code open as Administrator. After closing it and opening it normally I got the update to appear once again under the settings icon and in the Help menu.
If you cannot do that you can trigger the update with this command written in the terminal:
winget upgrade --id Microsoft.VisualStudioCode
My problem was with a later version, where update options did not appear under the Help menu. This may be because I ran a user install on a Win 2022 VM where I am Administrator user.
The above solutions did not work but I was able to resolve by running the latest user installer over the existing install (turns out the user install of VS Code does not appear in Control Panel, Uninstall program listing.) Currently this can be downloaded from https://code.visualstudio.com/.
If your update settings are OK, then there is one other possibility. Normally, you would have installed this huge piece of bloatware for your own user account only, using the "VSCodeUserSetup-.exe" installer.
But there is also a "system installer" which installs VSCode into "C:\Program Files" (configuration is still kept per-user). If you installed "VSCodeSetup-.exe" (note: no "User" in the installer file name), then you have an administrative install and will not get full auto-updates, AFAIK.

VS Code - WSL - Go To Definition not working

Pressing F12 to Go To Definition in VS Code is not working for me with WSL extension.
I verified F12 was being recognized by turning on Screencast Mode, and that WSL is causing the Go To Definition issue by uninstalling the WSL extension and trying F12 in another project.
Is there any other information I can provide? This was working for me a few days ago and nothing changed that I know of. I tried older versions of WSL extension and was not able to get Go To Definition to work.
Thank you!
I'am using VsCode with WSL extension for C# project and the next thing helped me. It looks like you have to install extensions for each language again in 'wsl version of vsCode'. Once you open project go to ExtensionManager and try to install adequate extension (in my case for C# that was omnisharp), instead regular install button there should be 'Install in WSL:ubuntu' button. Once installation is completed restart VsCode and it should/may work.
I noticed that the terminal was stuck in "starting..." state. I think I was able to resolve this issue by installing the "Terminal Here" WSL extension.

VSCode system-wide installation warning

These days, anytime I start VSCode, I get this warning
You are running the system-wide installation of Code, while having the user-wide distribution installed as well. Make sure you're running the Code version you expect.
Please how do I fix that?
UPDATE (Recommended by #Fabio Turati)
Just uninstalling the older one without the (USER) extension, it seems working. If not, then uninstall the one left and reinstall vscode.
additional reading:
You installed the new one (with USER extension) before uninstalling the older one. So now you have both, and this is why you get that message. You need to uninstall them both, then reinstall vs code. Make sure you add a shortcut on desktop, it took me a few more minutes to find the .exe of vs code. No worries you don't lose anything by uninstalling...
cheers !
You probably have both versions installed (like I do).
To get rid of the warning, make sure you open the user-wide version. That means unpinning the one you used to have from everywhere.
Then use windows (10) search: visual studio code . Only the ' user-wide distribution' gets shown. If you open visual studio code that way, the warning is gone.
i had these installed:
uninstalled the first one and that error message is gone.
The new executable of the "user-wide distribution" is in this location by default:
C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code\Code.exe
Replacing your shortcuts with this one should make sure you are using the new installation. (You can also uninstall the old one of course if you want to)
Run into this issue today but all I did was install the new one one (with user extension) and then after successful installation I uninstalled the the old one. Restart my computer and all seems to be ok.
I magically solved by (using windows 10):
Unpin from "taskbar" the vs code shortcut
Remove the shortcut from desktop also if you have it
Search on cortana "visual studio code", once the app appears right click and select "pin to taskbar"
Open tha vs code app from taskbar and the error should be gone.

Install VSCode in a specific folder

I just downloaded the Visual Studio Code App from https://code.visualstudio.com/ and when I tried to install it, it simply just installed it by itself, without the option to change the installation path.
I have an external harddrive, which is where I want the IDE to be placed instead of the Local Harddrive. How can I change this?
On the VSCode download page select "System Installer" instead of "User Installer". The System installer will prompt you for the install location.
Full credit to Hans Passant for giving the following working solution as a comment.
The installer does very little beyond copying the files, it just creates some Explorer context menu shortcuts ("Open with Code"). Otherwise following Chromium conventions and copying itself to c:\Users\yourname\AppData\Local\Code\app-0.1.0 so it can update itself without you noticing. Boo. So high odds that simply moving that folder to the other drive works just fine, put it anywhere and create a shortcut to Code.exe. If you still want the context menu entry to work then use Regedit and search for "code\app-0.1.0".