Trouble Accessing Solidity on VSCode - visual-studio-code

When I do Ctrl+Shift+P on VSCode, I am unable to see Solidity as an option. If unfamiliar with Solidity, it is a language for writing smart contracts on the Ethereum blockchain.
I tried typing
% brew tap ethereum/ethereum
followed by
% brew install solidity
on the terminal line (Mac) as described on many internet resources, but an error comes up which keeps suggesting I try "brew install --cask cmake", which I have done and has been successful.
Is there anything I can do to access Solidity in VSCode? Thank you.

You must install solidity as an extension.
You do that :
By pressing Ctrl/cmd + Shift + x
And then writing solidity into the search bar.
After that, you click on the Install button.

Related

How to uninstall VS code completely from manjaro linux, when terminal doesn't see it at all?

I am very new here, and also in programming.
I have found out that I have VS Code two times installed with different ways. When I started it from the KDE it ran well, but when I have started it from the current directory with "code ." it was an oss version without some extension and accounts.
Now I want to uninstall completely both of them. One version I could from terminal with yay --remove code. So the terminal can't see any versoion of vs code any more. But in the application launcher is vs code still there, I can run it and use completely. But I have no idea how to uninstall it.
I have already tried this: https://code.visualstudio.com/docs/setup/uninstall
you can uninstall from manjaro linux by visiting the add software>installed>code and clicking the trashcan near the name of the software. this will queue the action of deletion. Now just click apply on the bottom right of the screen and confirm all the things it will ask you. then it will uninstall code.
So I also had this problem, I found this command for uninstall vs code,
sudo pacman -R visual-studio-code-bin

why my vscode does not have the same libraries installed in wsl?

I'm using wsl and it runs codes in vscode pretty fine and I have different libraries which I installed through pip and conda in wsl but when I run that code using vscode itself it doesn't recognize the libraries or even pip itself.
I don't have any other environment.
I should add that I installed the packages globally using conda install ... or pip install ... in base environment and I only have base environment and I run my code through code . and I also have python and remote wsl extensions installed in my vscode.
what can be the problem?
I don't have much personal experience with this, but I found some useful information in this Stack Overflow question (even though it doesn't utilize conda), along with https://code.visualstudio.com/docs/remote/wsl-tutorial#_python-development.
I also found this blog post useful, even if it doesn't cover WSL.
In short, make sure you:
Have installed the Python extension (by Microsoft) in VSCode. This is critical for being able to detect and select the Python interpreter. You don't mention having this in place, so I believe this is your likely problem.
You have done this already, but including it for others who might read this later -- Install the Remote - WSL extension (or the Remote Development extension pack) in VSCode.
You are also doing this already -- Start VSCode from inside your WSL distribution. Alternatively, you can start VSCode from Windows and then select the Remote WSL - Reopen Folder in WSL from the Command Palette (also accessible from the "Remote" Status Bar).
In VSCode, open the Command Palette with Shift+Ctrl+P, search for the Python: Select Interpreter command, and you should find your Conda environment in the list.
After selecting this, you should find that your project is using the interpreter and modules that you have installed via conda.
One thing I did to overcome this issue is go to Extensions -> Local (You should have two tabs there, Local and WSL:DISTRO) DISTRO refers to whatever DISTRO you're using, you will see that some of the local extensions are disabled in the current workspace (WSL) and there is a little cloud icon in the WSL:DISTRO tab that says install Local Extensions in WSL:DISTRO once you click that it will let you choose which extensions to install and you should be good to go!

Pylance does not allow me to navigate to the source code, bringing me to the .pyi stub instead

I am using pylance for vs code and it works really nice, except that since I use it, when I try to check code from an installed library, I can get only to the stub, I think generated by pylance.
For example, the information shown about the function:
Or, crtl + click on the function brings me to the .pyi stub, which at
~/.vscode-server/extensions/ms-python.vscode-pylance-2020.11.0/dist/bundled/stubs/pandas/io/parsers.pyi
I can't find a way to navigate to the actual code (of pandas in this case).
If I deactivate Pylance and use Microsoft as language server by setting "python.languageServer": "Microsoft", in setting.json, the navigation to the library works fine.
Is it possible to navigate to the actual code with pylance active?
OS: Ubuntu 18.04
Visual Studio Code: Version: 1.50.1
Pylance: v2020.11.0
I had the same issue and realized I was using Docker. So I set up virtualenv and installed Django using pip.
Then I switched Python interpreter in the bottom-left corner of VS Code and it started working.
I know this is a specific case but I hope this answer helps someone in the same problem.
Let's remove ~/.vscode-server/extensions/ms-python.vscode-pylance-2020.11.0/dist/bundled/stubs/pandas
Then reload vscode
You can navigate to the references by right-clicking on the symbol and selecting "Go to References".
Also, ensure that you have a Python interpreter configured for the script where pandas is installed.
You can select an interpreter by opening Command Palette from the View menu and typing in "Python: Select Interpreter" and following through the dialog.
When you have that set, you should see two references when you Ctrl + click on a symbol: one for the stub and the other from the library.

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 plugin VSCode-PHP-Format not working

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