Autopop doesn't preselect

I have a similar issue to:

https://resharper-support.jetbrains.com/hc/en-us/community/posts/206659615-intellisense-doesn-t-preselect-in-this-case

https://stackoverflow.com/questions/49537548/visual-studio-autocompletion-pop-ups-dont-preselect-items

My options> env>:

'Intellisense> general' is set to resharper

‘Intellisense> Autopopup’, all five items under c++ are set to display and preselect. Yet, when the pop-up appears, nothing is selected.

0
10 comments

Hello,

Could you please show a screenshot or a screencast with a code completion session where the first suggestion was not preselected and the surrounding code? What R# version are you using?

Thanks!

0
JetBrains ReSharper 2023.3.3
Build 233.0.20240117.105338 built on 2024-01-17
ReSharper C++ 2023.3.20240118.164230
AI Assistant 2023.3.20240118.161109

Visual Studio Community 2022
Version 17.6.4, InstanceId 09560a90.
InstallVersion: 17.6.33815.320

If I initiate the popup myself with ctrl+space, then the first choice is preselected. If it pops up by itself, e.g., after a dot or →, then there's no preselection.

0

This is not expected and I believe the first choice should indeed get preselected after auto-popup.

Would you be able to update to the latest 2024.2 release and check if this helps?

0

It comes and goes; I'll keep an eye on it.

0

I'm starting to write

“using na”

A popup appears, the first suggestion is “using namespace,” but it's not selected.

Using: "Build 242.0.20240919.62458 built on 2024-09-19"

0

Another one:

template <class T>
void test() {
   std::array<int, 5> a;
   std::array<T, 5> b;
   a. // preselects
   b. // doesn't preselect
}
 

0

Zoharl3 In this case it's actually intended. array<T> is a template instantiation with an unknown template argument. R# can't know exactly which members are available there, so we prefer to not force completion with preselection.

0

Okay, but my humble opinion:

1. The object is an array, and the template param doesn't affect its methods.

2. Even if it does, as I user, I don't think or analyze it. If there's a popup and I press enter, I don't mean newline but the first selected item. 

By the way, due to dark mode or my high contrast, the selection is barely visible. I can never tell if anything is selected or not. 

I personally would prefer a consistent behavior: first item is always selected no matter what. I doubt if someone presses enter, they mean, “nah, I don't like any of the choices, let's write a new line.” They probably would press esc to close the popup first even if they do. I can't see anyone complaining: “I pressed enter while there was a popup, but since it's a template param, I feel oppressed that the first choice was preselected, and enter didn't ignore the popup and give me a new line”--in the middle of a line of code after writing a dot?

Sorry, it turned out as a vent--but it's unrelated to this.

0

Oh, I think I understand what you were aiming for. There's an option to apply completion with space--which I can't imagine anyone using. But for this option to work well, something needs to be pre-selected only with a good reason.

Fine. I suggest to have an option (default, for most users?) that completion happens only with enter, and the first option is always preselected. I believe it will save some grief for a lot of people:

https://stackoverflow.com/questions/31938749/resharper-intellisense-autoselect-first-option

 

0

Please sign in to leave a comment.