Enabling auto scroll in Visual Studio Code - visual-studio-code

Is there any way that we can enable auto scroll in Visual Studio Code? I have been looking in the settings but could not find anything(unless i missed something).
I am reviewing a log file and as it gets updated, its refreshed on my side. But it is not showing the latest logs but just stays where my cursor was and highlights everything that gets populated after that.

Had the same problem but did not find a setting within VS Code.
However there is an extension for VS Code:
https://marketplace.visualstudio.com/items?itemName=pejmannikram.vscode-auto-scroll
Works quite well for me.

There's now a built in VSCode setting - you can untick Smart Scroll option (output.smartScroll.enabled).
As described here:
VSCode: Turn auto scrolling permanently ON
"An option to turn off the smart scroll feature was included in one of the recents update (probably in the March 2020 update, I didn't found this on the changelog), see more: issue #69480
Since then, I've been able to "save" the scroll state, try this:
Go to File > Preferences > Settings (or Ctrl + ,)
In Features > Output, disable Smart Scroll option (or search output.smartScroll.enabled)"

Related

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

How to enable again the tooltip/hint in VSC?

My VSC shows the wavy underlines when something's wrong with my code, but does not display the hint overlay when I hover my mouse on it.
This happens whatever the language used (from CSS to Typescript) and whatever the type of irregularity (e.g. notice, warn, danger)
I'd say that's a setting I may have changed at some point, but can't find which one. Any idea?
More details:
I do have the message displayed in the Problems tab besides to the Terminal, but it forces me to switch from tab to tab ;
I do have other overlays like autocomplete/autosuggest ;
No extensions in my setup could have led to that situation (only a few installed, widely downloaded, nothing fancy or dodgy).
Actual behavior (nothing happens):
Expected behavior (from google images)
Go to File > Preferences > Settings.
Search for 'hover.enabled' (See below photo).
Toggle it.
If your editor still does not pick up the change, close all tabs, close all VSCode windows, and reopen it.
If it's still not working, try uninstalling VSCode and reinstalling it (make sure you don't have setting sync on).
Also, this question has been answered in at least one other place (Disable tooltip hint in Visual Studio Code)

How to remove top section in Visual Studio Code

I'm currently using vscode 1.36 and there is a top section that I want to hide, but I can't find any setting to perform this.
Click here for the screenshot
the X on the right won't fix the problem
I've already searched on Google but found nothing interesting except writing custom css using an extension. I don't like this approach.
Note that I've disabled tabs using this setting:
"workbench.editor.showTabs": false

How to hide/unhide comments with Microsoft VSCode?

I have a code with many comments, how can I hide these ones, but no delete, I need them after.
I need to hide all the comments in one click, not a simple collapse one
Can't find such feature as well.
Read this issue from GitHub - https://github.com/Microsoft/vscode/issues/46505
Seems like that VSCode can't do it (from the box) and all people waiting for that feature.
I was looking for a way to do that too as I put way too many comments making it hard to debug... and I came across this https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hide-comments it makes all the comments invisible, but it leaves special characters in place. There are also commands to toggle show/hide.
Hide Comments - Visual Studio Marketplace
We now have an extension for that. On the editor title, a toggle action is available to show/hide the comments quickly.
You can download from inside Visual Studio 2022 called unobtrusive code and it will hide all comments and put "+" symbols on the collapsed line to the left of your code that you can open or close them with. It works great.
*** TO GET THE EXTENSION: ***
I went to the Extensions menu at the top of VS 2022 and chose manage extensions.
Then in the manage extensions window that opens up, choose online then Visual Studio Marketplace. In the search at the top right of the manage extensions window type in unobtrusive code. download it and then exit Visual Studio. You should see a window pop up to install it.
When you start VS 2022 again and open a C# script, it should have all the comments minimized to the "plus symbols" to the left of the code!
Hope it works for anyone wanting to hide their comments.

VSCode: I want to remove annoying info message bar

Is there any way to completely remove this message popup or move it to somewhere?
I already know why this message comes, but I do not want to disturb my activity with annoying info popup.
When it pops up it hides the document tab, so I have to close it every single time. (I do not want to know how to fix this particular error message, this screenshot is just an example.)
It's very annoying and I've searched around for a way to remove it, but the answers keep saying how to fix that particular error and not how to hide the popup itself.
Press ESC.
I agree that this is really annoying. VS Code is all about high-speed workflow and not having to interact with anything except your code via keyboard. Everything has key chords, e.g. CTRL-P and CTRL-SHIFT-P. So having to stop what I'm doing, go to the mouse, and dismiss this popup, whenever a background task feels like completing (and not even really then, because the popup actually appears some short time later) just so I can get visual confirmation of which file I'm currently coding in, to refocus my work after being distracted by the same popup, is really awkward. They are in a stupid location and don't even fade away after time like well-behaved toasts.
That said, I think that's really two parts; the distraction, and relatively high workflow cost to dismiss.
It helped me a lot to learn that it can be dismissed quickly and easily with the ESC key. The other half the problem I still haven't solved, but hope that helps you.
In the screenshot it shows trying to validate PHP.
In a VS Code window select File > Preferences > User Settings
An editor will open on the left called Default Settings and on the right with a file called settings.json
In the right side editor you can add settings that will override those found in the left-hand-side one.
Between the braces type:
// Whether php validation is enabled or not.
"php.validate.enable": false,
Then save the document.
VS Code will no longer attempt to validate PHP files.
You can override any of the defaults using this method.
You can use the same technique for each Workspace (or project folder) using File > Preferences > Workspace Settings
You can't disable the alert bar in general as VS Code needs to tell you things and doesn't (thankfully) use modal dialogs to communicate.
Go to File > preferences > settings
Then add this to your user settings
"editor.parameterHints": false
You may want to try adding the line
"extensions.ignoreRecommendations": true
to your VS Code settings file (which you can easily reach with the keystroke (CMD + ,) on a Mac OS X or macOS system.)
Solution: User Preferences > change "editor.parameterHints": true to "editor.parameterHints": false
This will at least remove the obstructive boxes that appear above the cursor.