VS Code automatic indentation - visual-studio-code

I have a problem with automatic indentation in VS Code. If you pay attention to the gif below, you will see that the editor only moves a tab forward for the first time, but the second time it should automatically detect that a tab moves forward, but this is not the case. Many editors do not have this problem, but it has really become a problem for me. Also, for example, I do not want to press a shortcut key to solve this problem, I expect the editor to handle.

I found theanswer. Just disable trimAutoWhitespace in VS Code settings.

Related

Can I disable the Problem Window when using Go to Problem

When press F8 (Go to next Problem), a window opens with an explanation of the problem. Can I disable this window or set something different?
Can I instead of this window get the definition info? (assuming the problem is with the definition of something)
As far as I can tell from looking at the settings that exist in the current version at the time of thsi writing (v1.75) that contain the substring problem in the setting ID, there is not a setting to disable this problem explanation upon navigating back and forth between problems.
I also did not see any command/action to navigate back and forth between problems without opening the problem explanation.
It can be pretty easily closed by pressing escape.
If you really want such a feature, you can create a feature-request on the VS Code GitHub issue tracker.

right click context menu in vs code executes immediately

When I right click in the editor, vs code executes whatever menu item the cursor happens to be over. It happens far too fast for me to make my actual choice known.
I have already spent 30 minutes trying to find a solution. If you search for "right click" in the Command Palette, you are told there are no matches. You don't get any hits in the docs, either. Please advise. Thank you.
It has been reported that the situation you mentioned is a bug in the repository on GitHub. It is reported that Visual Studio Code works fine when zoom is disabled.
You can update the following setting to override this behavior:
"editor.mouseWheelZoom": false
Or you can update the mouseWheelZoom setting from the pop-up window by using the shortcut CTRL + , to go to Settings.
It's crazy, but this is still an issue for Linux users after so many years. Especially, when using a Laptop with touch-pad it makes VSCode frustrating to use. The problem occurs when you use "native" window style (you can tell, because the theme will not be applied to context menus) and have a non-default zoom.
The GitHub issue that #sercan linked to has a few solutions. In order to save you some time, there is basically two things that I found work and make sense:
Set your zoom level to default / 0. In settings.json add: "window.zoomLevel": 0 This works with all window styles, but obviously is not always viable
Change the title bar style from native to custom. In settings.json add: "window.titleBarStyle": "custom" This will change how the title bar but also the context menus look. Setting this, you can zoom in again

Smart Caret in Eclipse stops working for some files

I am using Eclipse and I am coding java. I really like the "Smart Caret" option for the Home and End buttons since it allows you to go the start and end of a line but not past any whitespaces. Also the Home key will take you to the start of a comment, rather than the start of the line. And you can cycle through different positions with these keys. And this is how the editor was by default, from installation.
However one thing that has happened a few times now is that when I am writing code in the editor, this functionality just vanishes. It is seemingly random when it happens and the weirdest part, I think, is that it is file specific. So all of a sudden when I am writing, the Home and End keys start taking me to the very start and end of the line I am on. It is as if I am accidentally pressing some hotkey to disable these Smart Carets for the specific file.
It does not help to disable and re-enable the Smart Caret option in Preferences. And beyond that I do not really know what to do. Is this a bug? It is incredibly annoying when it happens. Being used to things working one way, then having them spontaneously change and then again having them back to the default when I am editing a different file.

Using vscode, i am driven crazy by annoying pop hint every time when i hit Space key, How to solve this problem?

i am driven crazy by annoying pop hint every time when I hit Space key. As shown below:
Now, how to find out which extension or pop snippet hint is causing the issue when I hit space key and which one to disable it ?
There are two ways to solve this issue.
Method 1:
In VSCODE. click File > preferences > keyboard shortcuts and search for space you could see space might be wrongly assigned to some intelli sense. Click on that particular keyboard shortcut. Double click the stroke and change the shortcut.
Method 2:
Very expensive way.
Disable all extensions first and try the space keystroke then try enabling one by one. You will definitely find the culprit.
Hope it helps
I solved it eventually by disable all snippet extend one bye one, then the latest extensions, found out the cause is https://github.com/bauhausr/antd-intellisense extension.
It drives me crazy too. I just turned off Editor: Suggest On Trigger Characters and it seems to be working for me!

Issue with TAB and ENTER in vscode

So, Ive been using Visual Studio code now for several months, and I love it. BUT, there is one thing that is driving me nuts that I'm tired of dealing with.
VSCode has a terrible habit of changing my text when i hit TAB or ENTER at the end of typing. For example, Let's say I'm writing something and I want to tab over a few tabs. So, as an example:
I type "fix", meaning, i hit tab at the end so I can tab over a few columns. When I do this, my line changes to:
"<fix></fix>" (hope this doesnt looks weird, I had to edit to the tags wouldnt be hidden)
So, in order to tab to the right for in-line comments or something, I have to hit SPACE before i hit tab. Lame.
Similar stuff happens when I hit enter immediately after typing something. It changes my text to something else before leaving the line. So, again, I find myself adding an extra space at the end of every line.
Does an extra space hurt me in the long run? No. But my OCD is freaking out over it.
I dont have tab autocomplete turned on, so why is this behaving as such?
I'm using vscode on a Mac. I disabled and uninstalled all extensions... still happens.
So yeah, I've messed with this for days, and only now after I post a question do I figure it out. These two settings took care of my issues:
// When enabled, emmet abbreviations are expanded when pressing TAB.
"emmet.triggerExpansionOnTab": false,
// Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.
"editor.acceptSuggestionOnEnter": false
Emmet was the tab issue, and the accept suggestion on enter was the second, even though no suggestion was showing. Hope this helps someone else...