VScode Pylance python file path autocompletion - visual-studio-code

Recently I've installed pylance server (earlier I used Jedi), but it turned out that I have my file path autocompletion turned off. In Jedi it is out-of-box. How can I enable this option?
Jedi:
Pylance:
I tried setting up "python.analysis.include": ["${workspaceFolder}"], but it doesn't do a thing "python.analysis.indexing": true also useless

This is a feature only provided by Jedi. Pylance currently has no such feature.

Related

Why cannot I use the Vim VSCode extension over ssh or wsl?

I cannot install the Vim VSCode extension on my headless machine through VSCode remote development nor in WSL. I think I used to be able to but I uninstalled it once and since then I haven't been able to install it again. I can only install and uninstall on my Windows computer but not remotely: when I click the button to install Windows extensions to server, the Vim VSCode extension is not part of the batch:
Edit: actually the extension stopped working in Windows as well without obvious reason.
Here is a list of my extensions: maybe I introduced incompatibilities I am not aware of:
I wonder how to get a JSON list of the extensions by the way :(
I might be wrong but I don't believe the normal VSCodeVim extension requires Vim itself to be installed as it just emulates it, so it shouldn't need installed in the remote environment as long as it is installed/enabled which it looks to be. Is it not working?
There was a bug in the settings JSON file. There was some syntax error, possibly caused by the installation of some other extension.

VS Code - Prettier is formatting differently for me than others

Prettier is behaving differently for me compared to my team mates.
We all have same version 9.5.0 of prettier installed on our VS Code.
We all have same configuration of prettier.
Still it is formatting my typescript file differently for one particular line than others and because of this the deployment is failing when I push anything from my machine and works for everybody else.
Does anybody face this?
Which part should I check to see the difference?
Update 1
One thing we found that is different is the VS Code version.
I have version 1.67.2 installed my colleague has 1.63.2 installed.
Could this be the reason?
Update 2
This is the exact line where I am getting prettier error on my machine for wrong formatting while this same formatting is considered correct by prettier for other machines
And this is how prettier formats the line on my machine (then devops complaint that it is a wrong formatting)
I think there is a bug with the prettier extension. Although I had my default formatter set to the prettier extension in the settings UI, I had to re do it manually.
Open any file, right click in the editor screen, click Format document with and choose Prettier - Code formatter.
The local prettier config and the one vscode uses should work now
I faced the same isssue.
in my case I run
npx prettier --version
on both computer and each one return different prettier version.
so although the prettier extension in vscode was 9.5.0 for both pcs. the npm module installed for the project in node_modules was different.
I installed the same prettier module for both computer and the restart vscode and problem solved
You might have installed multiple formatters and you aren't using the correct one. Try to specify it manually in command palette. Check out this answer (Solution A)

VSCode Intellisense Not Working In Jupyter Notebook Extension(MacOS)

I have an issue with VS Code which I recently installed in my MacOS BigSur.
I tried out the Jupyter Notebook extension and in their documentation it says that they have full intellisense support for this extension as well.
Intellisense in Jupyter Notebook in VSCode works well for completing variables, functions,methods,etc....
The only issue I have is that I am not able to get the arguments/parameter information, though it is working fine with the python extension of VSCode
I tried out things like Shift+TAB...which works in JupyterNotebooks(not the VS Code version).
Is this a bug that I am facing...or is it just like that. Can you also please suggest as to how to make this work.
Edit May 12, 2021: With the Pylance language server (now the default), I now get parameters and type hints.
According to this issue on GitHub, the arg/param info is not supported on stable VS Code. It looks like you need to use the "Native Notebook" in VS Code Insiders (the beta) and use the "Pylance" language server Extension.
I haven't tried this solution myself (not sure I want to install Insiders), but just changing the language server to "Pylance" at least gives you signatures.

How to permanently disable pylance toast

VSCode 1.51.1
MacOS 10.15.7
I'm using the MS python extension. When I open python source code I get this toast:
Pylance extension is not installed. Click Yes to open Pylance installation page.
The project I'm working on uses python 2, which pylance does not support. I clicked on No in the toast. When I open another python file I still get notified to installed pylance.
Is there a way to disable this toast?
The Python Language Server used is determined by the setting python.languageServer
The 2 possible values are:
"python.languageServer": "Pylance"
"python.languageServer": "Microsoft"
If you change the setting to "Microsoft" it stops messaging about Pylance.
The setting can be in the global settings.json or the Workspace .vscode/settings.json
Edit
Recently 2 more options have been added
"python.languageServer": "Jedi"
"python.languageServer": "JediLSP"

Is it possible to specify the path to the libstdc++ in VS Code clangd extension?

I use VS Code as my main code editor for my C++ development. I am using the remote SSH extension by Microsoft to access my office workstation from home. For the C++ autocompletion and linting I use the clangd extension by LLVM. Company policy prevents users from having sudo access to workstations and libraries are often not at the latest version.
When I try to launch clangd I get the following error message:
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /my/path/to/clangd)
Which obviously means that the version of libstdc++ is too old for the version of clangd that I am using. This is easily fixable by adding to LD_LIBRARY_PATH the location of most recent gcc libraries (part of our compiler toolchain) and then launching VS Code.
However, now that I am working remotely I cannot do that because VS Code is installed onto my laptop and I am using the SSH extension to access the code on my office workstation. Looking on the man page for clangd I cannot see a way to specify the path to the libstdc++ that I want to use. Is there a way, other than adding the libraries to the LD_LIBRARY_PATH upon startup/login, to bypass this issue?
I found a way, albeit a little bit hacky.
Export the new LD_LIBRARY_PATH on .zprofile (or equivalent for your shell. I am using zsh). Make sure that there are no VSCode servers running in the host. If there are, make sure to remove them.
In the settings.json file add the following line, to tell VSCode that you want the shell to be a login, interactive shell:
"terminal.integrated.shellArgs.linux": ["-l", "-i"]
Job done. Clangd now finds the correct libraries.
Another way to do this is to use env in your settings.json as follows:
"clangd.path": "env",
"clangd.arguments": [
"LD_LIBRARY_PATH=<your_custom_path>",
"/path/to/my/clangd"
],