Vscode peek definition stops working after one/two use/s - visual-studio-code

I am using vscode version 1.51.1 e5a624b788d92b8d34d1392e4c4d9789406efe8f x64 on ubuntu version Ubuntu 20.04.1 LTS.
I am working on C code in Vscode. It has extension C/C++ (C/C++ IntelliSense, debugging, and code browsing.).
The option - peek definition works fine for the first one/two times but then goes away.
Screenshot of peek definition when working:
Screenshot of peek definition on second attempt - not working:
For now, to get the peek definition back, I have to either reload window (ctrl + shift + p -> reload window -> enter) or restart Vscode.
Any idea how to stop the feature from disappearing?

The problem persists when symlink is used to open the project in vs code. If the actual path is provided while opening the project, the plugin vscode-cpptools works correctly.
Refer link [issue on github] - https://github.com/microsoft/vscode-cpptools/issues/6280

Related

VS Code Terminal command extra first letter

In vs code terminal I'm getting first letter of command twice. it's not causing any problem but it's kind of annoys me to watch the wrong command. I'm not writing any letter twice, the first letter of all commands gets repeated automatically.
as you can see there are 2 commands first one ppython first p automatically got repeated even though i wrote python it makes it ppython. and the first p that got repeated won't delete from there even if i spam backspace so many time . the I tried to clear the command till first p and as I'm not able to remove first p from terminal I just wrote ython in front of it. it looks proper now python. but I got a error response as ython is not recognized command. this same happens with other commands too like cd converts to ccd.
Edit : I Re-installed vs code then but that didn't resolved my problem, when I installed it again all my extensions were there already installed then I deleted vs code again then went to the vs code's location there was a folder name .vscode I deleted that then installed vs code again now all the extensions were deleted from vs code but I'm still having the main problem . that doesn't resolved it. and I'm not getting that error while using other terminals like git bash and I'm getting this error only when I open python file's folder not when I open a react app folder or normal js or other language.
I also tried reseting the default setting from setting.json file as one of the answers suggested but that doesn't worked.
It's hard to answer this without knowing your configuration. What plugins have you installed? Try disabling those related to the terminal emulator one by one to see if they're causing any issues.
In doing this, you would naturally restart the terminal emulator as well. If the problem persists, check if you get this erroneous doubling on a terminal emulator outside of VS Code (Terminal or PowerShell).
If nothing works, try reinstalling the interpreter and also VS Code. Especially the latter, if this seems to affect only the terminal emulator within VS Code.
It's really hard to answer your question without knowing your vs code configuration setting.
The easiest way is you can reset your vs code to default
The Steps
Go to View > Command Palette or press Cmd + Shift + P (macOS) or Ctrl + Shift + P (Windows).
Search for open settings json and select Preferences: Open Settings (JSON) which show ups from the result list.
If you’ve been working with VS Code for a while and installed a lot of things and made a lot of changes, you’ll find there’s a lot of stuff in this file:
Delete everything inside the root braces and save the file
Relaunch your VS Code.
(This step is optional) In case you want to not only reset VS Code but also remove all installed extensions:
Delete the ~/.vscode/extensions folder if you’re on a Mac.
Delete the %USERPROFILE%.vscode\extensions folder if you’re using Windows.

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 Intelephense Clear Cache and Reload

I use Visual Studio Code with Intelephense, and this works wonders on all of my projects except for one, where every class is shown as undefined until I open the file that contains the class. Therefore I have a suspicion that Intelephense is not scanning this project.
Some suggestions around the web mention to perform a "Clear Cache and Reload", however I cannot find this option anywhere. Can anyone show me where I can locate this, please?
I am using Windows 10, VS Code 1.46.1, and Intelephense 1.4.1
It appears to have been removed in version 1.0.0 (2019-02-20), as referenced in their change log in GitHub, in favour for "Index workspace". This can be activated by opening the command pallet (Ctrl + Shift + P) and typing "Intelephense: Index workspace".
However this did not resolve the indexing issue. This was in fact caused by a problematic symlink that somehow was linked to itself. When I have removed it and restarted VS Code, the indexing worked as expected.

( Ctrl + / ) Shortcut does not work properly in VSC

I am using Visual Studio Code on Windows.
ctrl + / does not work after a while I started VSC, so I have to restart in every few minutes.
Sometimes, it suddenly works again even though I didn't restart it, so I have no idea why is this happening.
Just in case, I've checked my keyboard shortcuts,
but nothing other than the default one is bound on Ctrl + /.
My installed extensions on VSC are listed below.
Beautify
Dracula Official
ES7 React/Redux/GraphQL/React-Native snippets
HTML to JSX
One Dark Pro
open in browser
I haven't installed any other extensions in my knowledge.
I had the same problem on Linux. Perhaps you have keybinding conflicts with the toggleExplaneMode function. This function allows you to deploy a more detailed description of tags or functions in the dialog box. I changed my keyboard shortcuts "ctrl + /" also attached to toggleExplaneMode and this problem did not appear anymore.
How to see keybinding conflicts - https://code.visualstudio.com/docs/getstarted/keybindings

VS Code open dialog in the current folder

While working with the VS Code I was confused that the Open dialog (command + O) always opens project root. Expected behaviour is to open the folder containing current file.
Is there any option to switch this behaviour?
I think dialog window behavior depends on the OS.
You should specify what version of vs-code and what OS you are using it on.
For me is a Linux x64 with KDE desktop environment and the expected behavior works fine.