Visual Studio Code - Prevent Intellisense popup without disabling Intellisense completely [duplicate]
Asked Answered
P

2

5

When Intellisense is enabled in Visual Studio Code, VS Code will continually produce pop-up windows as you type with autocomplete suggestions.

The user can then select one of these by pressing tab, enter, etc.

The problem with this is twofold:

  • The popup window obscures code behind it. This is a problem if you are copying code from the lines which happen to be obscured, or you just need to see those lines of code for any reason.
  • The popup window steals keystrokes, such as arrow key navigation movements and, obviously, pressing Enter.

The second of these issues can be addressed by re-assigning the key bindings so that, for example, CTRL+UDLR is used instead of UDLR arrow keys.

I don't know how to resolve the first problem.

I do not want to disable Intellisense completely, as I then loose some useful features, such as being able to look up where classes/types are defined from the Right Click menu.

Since I am working on a large codebase, this feature is pretty much non-optional.

Is there a way to prevent the popup from showing automatically. In an ideal world, I would like to be able to assign a keyboard shortcut to trigger the Intellisense popup to load, but I don't know if that is possible?

In short

  • How do I stop the Intellisense popup from showing without disabling Intellisense
  • Can I assign a keyboard shortcut to trigger the popup to load if I want to see the autocomplete suggestions at a particular time?

Note: When I say Intellisense I mean the information that the C++ Extension Pack provides. It might be called something different, I know it as Intellisense from using Visual Studio back in the day.

Related Questions

Pops answered 25/8, 2022 at 8:43 Comment(2)
I should add, I have already tried unticking the context specific options for this. Settings>Editor>Show Functions is one example. But if I understand correctly (I'm not convinced that I do) this disables Intellisense for function contexts which isn't what I want.Pops
see also https://mcmap.net/q/2035877/-how-to-get-rid-of-automatic-auto-complete-in-vs-code-duplicate/11107541Rotman
P
3

Today I have half an answer after accidentally discovering this keyboard shortcut: CTRL + I

It seems that the default mapping for Trigger Suggest is what I was looking for, and answers part of this question.

I still don't know how to stop the popup raising itself by default. If I can get that to stop happening, then CTRL + I can be used to trigger the suggestions box to be shown.

VS Code Suggestion Keyboard Shortcut

Edit: There is now a solution for this:

see this Stack Overflow question and answer

Pops answered 20/9, 2022 at 12:2 Comment(0)
V
3

You could specify super long delay in settings like this "editor.quickSuggestionsDelay": 60000 (it's in milliseconds so it will automatically show only after a minute, but still can be triggered with shortcut), here are the docs.

I believe there was also a setting to set a number of needed characters after which it will trigger suggestions but i can't find it right now.

To trigger suggestion with shortcut find Trigger Suggest in shortcut list (open Command Pallet and search for Keyboard Shortcuts), by default it's CTRL+Space

Vindicate answered 25/8, 2022 at 13:51 Comment(1)
I might have to ask the devs for this feature, but my suggestions don't usually get enough upvotes on github to motivate them to implement themPops
P
3

Today I have half an answer after accidentally discovering this keyboard shortcut: CTRL + I

It seems that the default mapping for Trigger Suggest is what I was looking for, and answers part of this question.

I still don't know how to stop the popup raising itself by default. If I can get that to stop happening, then CTRL + I can be used to trigger the suggestions box to be shown.

VS Code Suggestion Keyboard Shortcut

Edit: There is now a solution for this:

see this Stack Overflow question and answer

Pops answered 20/9, 2022 at 12:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.