How to determine the rust-analyzer version used by VSCode? - visual-studio-code

How can I find out which version of rust-analyzer is used by the extension with the same name in VSCode?

Displaying the rust-analyzer version is possible via a palette command in VSCode:
Open command palette Ctrl/⌘+Shift+P
Type / select: rust-analyzer: Show RA Version
Under Linux, the extension installs the rust-analyzer binary into ${HOME}/.vscode/extensions. Therefore, the reported version by the command should be in line with the output of
${HOME}/.vscode/extensions/rust-lang.rust-analyzer-*/server/rust-analyzer --version
(unless rust-analyzer.server.path is configured manually.)

Related

VS code clang-format extension not working in wsl

I am using vscode and the Xaver Clang-format extension via Wsl with a custon .clang-format file.
The extension does nothing when I save the file and when I select the option from the right click menu, I am however able to use clang format via the wsl terminal with clang-format -style=file -i "Path to my file"
"editor.formatOnSave": true,
"clang-format.executable": "/home/fede/skyward-boardcore/.clang-format",
"clang-format.style": "file",
This is the part relative to the extension in my settings.json file.
I am using Windows 11 pro Version 10.0.22000 Build 22000 with Ubuntu 20.04.3 and vscode version 1.63.
Does anybody know how to fix this? Thanks for your time
clang-format.executable would be the location of clang-format:
"clang-format.executable": "/usr/bin/clang-format",

issue with vscode-neovim navigations

I am using VsCode on MAC OSX.
I installed vscode-vim and editor works fine.
Now, I installed vscode-neovim extension and updated settings.json with below
"vim.enableNeovim": true,
"vim.neovimPath": "/usr/local/bin/nvim"
However, when I press arrow-keys in editor, I am getting below message
command 'vscode-neovim.up' not found
I checked the Keyboard Shortcuts see below entries for vscode-neovim.up, etc. like below
attachment.
Am I missing any other configurations?
thanks,
I had a similar issue after just installing vscode-neovim. It appears the current extension requires version 0.5.0 or later of neovim, which is a nightly/development release. On OSX, you can install it with brew install --HEAD neovim or see here for releases.
You probably also want to uninstall the vscode-vim extension from VSCode: these are conflicting extensions, not complementary.

VSC throwing an error when running powershell script

Just started getting following error, when I open Powershell Script in Visual Studio Code. It was working fine till yesterday.
Here is the error:
The language service could not be started:
Error: The language client requires VS Code version ^1.26 but recevied version 1.25.1
I googled it found a page which said to change package.json file to older version, but I cant find that file, I am using a macos.
Your problem is incompatible versions. The PowerShell extension is using a later feature in vscode that is not available in the version you have installed.
You can:
Upgrade vscode (if auto-update is failing, you can download the installer and re-run it)
Downgrade the PowerShell extension
Use the latest VSIX that worked for you
Use Extensions: Install from VSIX... from the Command Palette (CTRL+SHIFT+P) in vscode
Turn off auto-update on your extensions by adding the following to settings.json:
"extensions.autoUpdate": false,

How to run VS Code Insider version when I have regular VS Code installed side by side on MacOS?

I have both VS Code regular and Insider installed side by side on MacOS. But running code on command line always opens up the regular version. How do I open the Insider version instead?
You can manually add the current build (whether insiders or not) to your PATH by opening the vscode command pallet and entering Install "" command in PATH.
Command for insiders is: code-insiders.
vscode CLI

Real-time linting of Python with VSCode

Recently I'm using VSCode as my Python IDE, and I install
DonJayamanne/pythonVSCode, which supports linting. However, the linter only works when saving, but what I want is real-time linting. The workaround suggested by the author is to set files.autoSave to on, so that the linter will work whenever the file is automatically saved. There's a relevant discussion on Github, for your reference.
Since I don't want to turn on auto-save function, is there any way to do real-time linting of Python with VSCode? Or is there any suggested extension?
If you use shift + cmd + P (or ^+ctrl+P for windows) or go to View > Command Palette and type "Lint"
The Command Palette allows you to execute different commands, from here you can enable/disable Linting and select which Linter you would like to use. Most popular is PyLint but you can select Flake8 or Pep8 or whatever you like.
I believe you need to do these things before the linter works in real-time.
To scan for problems with your code without saving first, use shift + cmd + M, you will receive an error code in the vscode Terminal.
EDIT
Update 4 Jul 2022
New version of python extension deprecates "python.pythonPath" and suggest to use this instead.
"python.defaultInterpreterPath": "/usr/bin/python3",
Put these lines in .vscode/settings.json
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.pythonPath": "/usr/bin/python3",
"editor.formatOnSave": true
}
And install autopep8 package.
Use pip to install it
python3 -m pip install autopep8
Or in Debian based as python3-autopep8 exists in repo you can run
sudo apt install python3-autopep8
And then python linting on vscode will work.
Also, the Warning menu will activate.
Hint that I set run linter onsave.