- I already have Automatic brace completion disabled. That's not the issue here.
- I have a nested class
Outer.Inner
. - Normally when I type
out.
it auto-completes toOuter.
and brings up another intellisense list withInner
in it. - But if I type
new out.
it auto-completes tonew Outer().
, which is really unhelpful. Even more so since theOuter
class doesn't even have a parameterless constructor.
Asked
Active
Viewed 201 times
0

Harkirat singh
- 599
- 6
- 19

SilentSin
- 1,026
- 9
- 18
-
Do you really commonly have situations where nested classes are being referenced from *outside* of the class they're nested in? That would seem an unusual setup. Most of the time they're only referenced from within the outer class itself in which case the outer name isn't required. – Damien_The_Unbeliever Jun 25 '21 at 09:40
-
Whaich version of visual studio you are using? – Harkirat singh Jun 25 '21 at 09:41
-
@Damien_The_Unbeliever Yes I do. A lot of them in fact. But we're not here to argue the benefits of my coding style. If you're interested in my reasoning, we can discuss it elsewhere. – SilentSin Jun 25 '21 at 09:50
-
@Harkiratsingh Visual Studio Community 2019 Version 16.10.1. – SilentSin Jun 25 '21 at 09:51
-
Are you using ReSharper, or only vanilla visual studio? – Rand Random Jun 25 '21 at 09:58
-
@RandRandom I have some extensions, but no ReSharper and nothing else that looks like it should cause this behaviour. – SilentSin Jun 25 '21 at 10:01
-
Was asking since I installed Visual Studio 2022 recently which has no extension, and everything still default, and I don't get the described behaviour. It only writes `Outer` without the `()` when I hit tab or enter, after I typed `var x = new Out` – Rand Random Jun 25 '21 at 10:50
-
I agree, we're not here to discuss your coding style, but please realise that nested classes (somewhat rare), accessed externally (quite rare) and *constructed* externally (very rare), **and** where construction of the outer class doesn't occur is probably not on anyone's radar, let alone they provide an option to prevent it. – Damien_The_Unbeliever Jun 26 '21 at 19:53
-
And you have to compare that necessary analysis vs a simple type vs namespace check when `.` is hit. – Damien_The_Unbeliever Jun 26 '21 at 19:56
1 Answers
0

Dylan
- 504
- 2
- 5
- 9
-
1Avoiding this one small annoyance isn't worth disabling automatic completion for everything else. – SilentSin Jun 28 '21 at 08:43
-
Visual studio cannot disable it for single situation currently. If you need it, you can provide a suggestion here: https://developercommunity.visualstudio.com/report?space=8&entry=suggestion – Dylan Jul 14 '21 at 09:17
-
Yep, I did: https://developercommunity.visualstudio.com/t/automatic-constructor-completion-is-unhelpful/1460935 – SilentSin Jul 15 '21 at 10:03