Autopop doesn't preselect
I have a similar issue to:
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.
Please sign in to leave a comment.
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!
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.
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?
It comes and goes; I'll keep an eye on it.
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"
Zoharl3 Thanks, filed RSCPP-36345
Another one:
template <class T>
void test() {
std::array<int, 5> a;
std::array<T, 5> b;
a. // preselects
b. // doesn't preselect
}
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.
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.
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