Configuring the Visibility of the V.S. Code scrollbar - visual-studio-code

Usually when an editor is empty, the editor hides the scroll bar, but when there are just two lines in V.S. Code, the scrollbar is visible. Is there a way to configure V.S. Code so that the scrollbar remains hidden until the number of lines-of-code exceeds the amount of lines that are visible in the editor?

V.S. Code Scroll-bar
Your not going to be able to get exactly what your looking for, but I will clarify, what you are able to do, and you can decide the best option that works for you. I will attempt to outline the answer to cover the topic in a way that it is useful to anyone else who is looking for the same topic via stack overflow search-queries.
The setting that affects the visibility of the scrollbar is editor.scrollbar.vertical, and it is the only one, however; there is also editor.scrollbar.verticalScrollbarSize which changes the size of the scroll-bar (I guess, as a technicality it can affect its visibility as well, since setting it to 0 hides the scroll-bar).
editor.scrollbar.vertical has 3 settings, and they are as follows.
Auto – "Assigning the value auto will hide the scrollbar whenever the editor is not in focus."
Visible – "A better name perhaps, would be "Always Visible", since assigning the value visible always makes the scrollbar visible, even when working in the workbench, or terminal."
Hidden – "I think we can all take a pretty good guess at what assigning hidden does. It hides the scrollbar.... I guess I should point out that this too is a case of "always", as it always hides the scrollbar."
V.S. Code is a highly configurable editor, and I personally love it for that reason, but to be fair; V.S. Code lacks in configurable scrollbar settings, there isn't a lot that can be done to customize it, and this has lead to several issues and suggestions created in the V.S. Code Repository. Perhaps the most appealing aspect to V.S. Code, is there team. The VSC team listens to suggestions, as they deliver when a suggestion is popular, perhaps try creating a suggestion — just remember to make sure no one else has already suggested it.

Check this setting:
Editor > Scrollbar: Vertical
the default is auto, is yours changed to visible? Which would be always shown.

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 make VSCode Intellisense window wider

I have a VSCode extension that helps me autocomplete file paths, however many file paths grow long and are truncated in the VSCode intellisense popover window.
How can I set VSCode to either:
have a fixed width that I can set to be large
automatically expand to fit the intellisense options (preferable)
I happen to have written the extension so if needed I can update it if that is required.
One way around this is to press Ctrl + Space (or what ever your "Trigger suggestion" shortcut is) while the suggestion popover is open to show more detail about current selection.
So this (where I can't differentiate between the Trans imported from #lingui/macro and the one from #lingui/react):
Becomes this:
I don't think this is possible, VSCode generally gives extensions very little control over the built-in UI. See also the Restrictions section of the Extensions Capabilities Overview. Technically there is a way to hack around that, but I wouldn't necessarily recommend it.
There are also a number of settings for the suggest widget, but none of them seems to correspond directly to width. The closest you can get would be reducing the font size with "editor.suggestFontSize".

How to completely hide comments in eclipse?

I'm not sure if this is a good place for this question, but I did see a similar question posted here on overflow.
I'm just getting started with Eclipse as an IDE and having difficulty finding a comments toggle. I'd like to completely hide them sometimes. I've seen suggestions that would allow me to collapse entire comment blocks to a single line, but I'd want to hide ALL comments (single lines, blocks, etc) like in visual studio as a comparison. The goal is to gain the screen space to see more actual code simultaneously.
Anyone know of a way, plugin or otherwise?
Thanks!
This might be a bad way of doing it but you could set the syntax highlight for comments to be the same as your background color.

How to highlight current method body in Eclipse?

There is a nice feature called "show selected element only" in Eclipse. When it's turned on, clicking on a method in the outline pane will show just this method only in the editor, allowing to focus on this one only, especially useful in that you don't need to worry about scrolling hard and overshooting this method when there are many nested parenthesis inside.
But sometimes I would like to have a glance of more codes around here, so have to turn this off, then back, time and time again, which is quite inconvenient. So I wonder if there is a better mechanism?
I know a built-in feature called "range indicator" (http://stackoverflow.com/questions/7049098/how-to-forbid-eclipse-to-highlight-current-method-class-in-the-margin) , but I always tend to overlook that because it's too thin.
One better solution I can imagine is using distinguished background color for currently investigated method body, and when move cursor to other methods, background highlight turn to them accordingly (works like the range indicator, but renders more obviously). In this way, both navigation flexibility and reading assistance are gained.
Is this solution possible?
Take a look at the Editbox plugin.
You might have to do a bit of tweaking to the colors to set it up. Here is a sample screenshot :
Is this what you wanted ?
Yes, with editbox and the following settings may suit your need.

Is there a way to make a toplevel GTK window smaller than the default minimum size?

I need to draw a few small undecorated windows on top of another app's window. Each of these windows contains just a short label. It works fine but the windows are too big for my purpose. It seems as if Windows doesn't allow smaller than 104 x 27 toplevel windows, I might be wrong. I haven't tested on another backends. I'd like to shrink them to just the size needed to display the label. Is there a way to accomplish this?
Trying out things, I figured that setting the type hint with gtk_window_set_type_hint to GDK_WINDOW_TYPE_HINT_UTILITY allows the window to shrink horizontally but not vertically. I'm not sure what other implications this has. But it didn't solve the problem anyway.
I'm looking for a portable solution but platform-dependand answers are welcome too. Any help appreciated.
Edit: As usual, the solution is trivial. I had completely forgotten the GTK_WINDOW_POPUP window type.
Edit: Making the window GTK_WINDOW_POPUP has some unfortunate side effects which make it unusable for my purpose. I eventually got GTK_WINDOW_TOPLEVEL to work as expected. The key was to do gtk_window_set_resizable(window, FALSE) after the the window has been exposed.
Use gtk_window_set_resizable, this affects user resizes, which apparently includes resizes requested by the window manager. Setting it to FALSE therefore makes the programmatic value stick.