Don't Let Me Catch You Napping
-
Visual Studio "intellisense" shows signs of brilliance; then there is: I typed:
public void Initialize( float minutes ) {
this.TimeRemaining = TimeSpan.
}I expected:
this.TimeRemaining = TimeSpan.FromMinutes( minutes );
I got:
this.TimeRemaining = TimeSpan.FromSeconds( minutes );
... repeatedly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Visual Studio "intellisense" shows signs of brilliance; then there is: I typed:
public void Initialize( float minutes ) {
this.TimeRemaining = TimeSpan.
}I expected:
this.TimeRemaining = TimeSpan.FromMinutes( minutes );
I got:
this.TimeRemaining = TimeSpan.FromSeconds( minutes );
... repeatedly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
In my copy of VS 2022 when I start typing the word "From" I see a list of all available methods, including FromMinutes. It doesn't auto select FromSeconds. I just arrow down to fromminutes and select that. when I type frommi it automatically shows fromminutes. As far as I can tell this is by design and I don't see anything out of the ordinary. It is what I would expect.
-
Visual Studio "intellisense" shows signs of brilliance; then there is: I typed:
public void Initialize( float minutes ) {
this.TimeRemaining = TimeSpan.
}I expected:
this.TimeRemaining = TimeSpan.FromMinutes( minutes );
I got:
this.TimeRemaining = TimeSpan.FromSeconds( minutes );
... repeatedly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
I'm using VS2022 17.4.4 and get what you expected:
this.TimeRemaining = TimeSpan.F_romMinutes(minutes);_
-
Visual Studio "intellisense" shows signs of brilliance; then there is: I typed:
public void Initialize( float minutes ) {
this.TimeRemaining = TimeSpan.
}I expected:
this.TimeRemaining = TimeSpan.FromMinutes( minutes );
I got:
this.TimeRemaining = TimeSpan.FromSeconds( minutes );
... repeatedly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
It's probably selecting the
TimeSpan
method you've used repeatedly recently. VS's intellisense has tried to become better at predicting what you intend to type. What happens if you wait a couple of seconds? Does it then show you all the methods? /raviMy new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
-
Visual Studio "intellisense" shows signs of brilliance; then there is: I typed:
public void Initialize( float minutes ) {
this.TimeRemaining = TimeSpan.
}I expected:
this.TimeRemaining = TimeSpan.FromMinutes( minutes );
I got:
this.TimeRemaining = TimeSpan.FromSeconds( minutes );
... repeatedly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Visual Studio "intellisense" shows signs of brilliance; then there is: I typed:
public void Initialize( float minutes ) {
this.TimeRemaining = TimeSpan.
}I expected:
this.TimeRemaining = TimeSpan.FromMinutes( minutes );
I got:
this.TimeRemaining = TimeSpan.FromSeconds( minutes );
... repeatedly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
Stuff like that's why the last time I was doing C#* I actually ended up backing off the more advanced auto-complete features. It might be 90% correct and I might catch 90% of the times it's not as I'm going; but the hundredth time when the problem is that the code I intended to write isn't what VS created ended up causing more than 100x the frustration and taking more than 100x the time trying to debug. * I'm currently doing java, and Android Studio's autocomplete isn't smart enough to footgun me regularly.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius
-
Stuff like that's why the last time I was doing C#* I actually ended up backing off the more advanced auto-complete features. It might be 90% correct and I might catch 90% of the times it's not as I'm going; but the hundredth time when the problem is that the code I intended to write isn't what VS created ended up causing more than 100x the frustration and taking more than 100x the time trying to debug. * I'm currently doing java, and Android Studio's autocomplete isn't smart enough to footgun me regularly.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius