Code snippet floating in mid-air as a tooltip, cannot hide it, after extracting method [IntelliJ Idea / Android Studio] - android-studio

Trying to perform the Ctrl + G (Go to line) keyboard shortcut, seems I accidentally activated a feature that pins the code the cursor was previously on.
After closing and reopening the file, things are worse; the code snippets still are floating over the screen, no matter if I move the Android Studio window.
I have searched keyboard shortcuts using this guide, but no luck.
Is there a way to disable or revert this?
Noticed by comment below and confirmed by myself: This happens after extracting a method.

I have been able to get rid of those permanent tooltips by invalidating caches and restart, but this should not be the way to disable them, as I still don't know which is the keyboard shortcut to toggle this "pin snippet" function.

Related

I've accidentally added a number label in front of a file in Android Studio and I'm not sure how to get rid of it

I was trying to refactor a filename in Android Studio when I accidentally mistyped the keyboard shortcut.
Since I have a 75% keyboard, I don't have F rows. So I tried to hit Shift+FN+6, which would result in inputting Shift+F6, which is the keyboard shortcut for refactoring. But because of my typo, I hit some other keyboard command. Probably did <some keys> + 6 by accident.
Now there's a little 6 label listed in front of the filename:
Does anyone know what shortcut I accidentally hit, so I can undo it? I found an SO user who did the same thing as me but he got no replies. I tried hitting a bunch of random shortcuts and looking in the options menu but I can't find the option that I must've hit.
https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf
Android Studio is based on Idea and inherits its features.
I'm guessing this could be the numbered bookmarks feature. Try Shift-F11 to list all bookmarks or Ctrl-F11 to toggle it.

Forward slash key not working in VS2019 code editor

Since a few days (I don't know exactly when it started) the forward key in VS2019 is not working in the code editor. No matter how many times I press it, it doesn't do anything.
It also doesn't work in the seach box in the menu bar (labelled 'Search (Ctrl+Q)') nor in the search box which appears with Ctrl+F.
It does work in other places, like the solution explorer search box (Ctrl+;) and in the resource editor.
The forward slash is working in any other application that I tried (including Visual Studio Code and MS Excel). The question mark (Shift+/) is working everywhere, including in the code editor window. Even AltGr+/ is working (producing the Spanish upside down question mark).
I tried all other keys, including the AltGr combinations. They all work fine. Keyboard layout is US International.
The foward slash key doesn't work in the code editor when typing it on the laptop keyboard, and doesn't work when typing it on an external keyboard, or via an RDP session.
I am running Windows 10 Pro 64-bit, version 20H2, build 19042.685. System is up to date.
Visual Studio Professional 2019, 16.8.3, also up to date.
What is causing the forward slash key to fail?
How can I solve this problem?
(Too long for a comment.)
The OP indicated that the problem was resolved after resetting the keyboard shortcuts, which suggests that / was set as a keyboard shortcut either by accident or perhaps by an installed extension.
However, the question remains in such cases of how to identify what a particular keyboard shortcut is assigned to, in order to turn off just that one shortcut as opposed to resetting all.
Visual Studio does not appear to provide a place to see the list of all active keyboard shortcuts. An alternative is to go to Tools / Import and Export Settings / Export Selected / All Settings and save a .vssettings file with all the current settings. That is a plain text file with extended XML sections, and the keyboard shortcuts can be found under the following node (reformatted for readability):
<Category name="Environment_KeyBindings" ... >
<Version>16.0.0.0</Version>
<KeyboardShortcuts>
<DefaultShortcuts>
<Shortcut Command="View.ViewCode" Scope="Global">F7</Shortcut>
...
</DefaultShortcuts>
<UserShortcuts>
...
</UserShortcuts>
</KeyboardShortcuts>
</Category>
One of the <Shortcut> lines would have been listing / before the reset, and the Command attribute on that line indicated the assignment, so that it could be located and turned off individually in Tools / Options / Environment / Keyboard.
#dxiv Your comment made me check the shortcuts. Tedious job, scrolling through those hundreds of options). Nothing. Then I clicked the Reset button. That solved the problem.
In my case, the CodeRush extension was the guilty party. "Selection comment" gets set to use / upon installation. WTG DevExpress ......
https://docs.devexpress.com/CodeRushForRoslyn/120205/coding-assistance/selection-tools/comment-uncomment-selection
Update:
Also adding a screenshot of it in VS 2022 to help people find it:

Make Android Studio autopop up not change constrast

In Android Studio, pressing the up an down arrows will change the contrast of the autopopup bar.
Before
After
This also occurs in the default themes. Is there anyway to make the contrast start in the after position, even without pressing any arrows?
The popup is dimmed to indicate that there is no default selection for completion. It depends on context and in some cases the first entry will be selected automatically, while in the other cases you need to select the completion varian with the arrow keys first.
To get the pre-selection work automatically in IntelliJ IDEA and Android Studio enable the Insert selected suggestion by pressing space, dot, or other context-dependent keys option:
In some other cases it may be also necessary to add
-Dide.completion.lookup.element.preselect.depends.on.context=false
in Help | Edit Custom VM Options and restart the IDE.
Related issue: https://youtrack.jetbrains.com/issue/IDEA-193090.

VsVim: Is there a way to dismiss ReSharper intellisense and stay in insert mode?

When using VsVim and ReSharper, I type something that brings up the intellisense window. I want to make it go away, so I press the escape key. The intellisense window is gone, but I'm also back in normal mode.
Is there a way to make the intellisense window go away and stay in insert mode?
I'm currently working on a guide for working with VsVim and Resharper ( https://github.com/keithn/vsvimguide )
One of the little tricks I found for this situation is to press Alt then Alt again and it gets rid of the autocomplete.
What it's actually doing is taking you to the menu bar then takes you back to editing but ditches the autocomplete in the process.

Visual Studio: Undo-redo of replace-action does not scroll editor window

I did some find-and-replace actions in my C++ code with visual studio:
only single find-and-replace actions (did not use “replace all”)
only one file affected (did not change multiple files at the same time)
thus, a very simple case!
Then I wanted to undo these changes. So I pressed ctrl-Z one time. This had the desired effect. The latest change (which was still visible in the current screen) was undone.
But I also wanted to undo the remaining changes. These changes where currently not visible on the screen. So I expected the editor to scroll there when pressing ctrl-Z.
But unfortunately the editor did not scroll to the position of the undo when I pressed ctrl-z.
The undo worked, however. I checked by scrolling to the position manually.
Then I tried it with redo. Same result: Redo worked, but the editor did not scroll to the position of the redo.
Finally I tried if this also happens when I undo-redo other types of changes (not made by the “find and replace” functionality).
Result: Undo-Redo worked correctly and also scrolled correctly!
Thus: It seems only changes by the “find and replace” functionality are affected by this problem.
Did you also have this problem and found a solution?
Please help me!
Regards Gerhard
I am having the same thing happen in Visual Studio Ultimate 2012 (Version 11.0.60610.01 Update 3).
It might sound like it's not that important, but it is really hurting the usability of this otherwise great IDE!
PS I've been using VS since the 90s, I still haven't found anything better. I wish MS would put macros back into VS, even if it's VBA (or Python)

Resources