dotnet/roslyn

Intellisense autocompletes if((true)){} for unknown reason

Open

#77.868 geöffnet am 27. März 2025

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)C# (4.257 Forks)batch import
Area-IDEBugFeature - Semantic Snippetshelp wanted

Repository-Metriken

Stars
 (20.414 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)

Beschreibung

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] Intellisense likes to autocomplete the following code when I type "if(":

if((true))
{
                  
}

The "true" is selected, being replaced by whatever is typed next, leaving an extra set of parenthesis () that must be manually deleted. This code is not a suggestion and fully types itself out on typing "if(".

I cannot imagine a productive use case for this behaviour. It appears to be some kind of template, as I would never willingly type this myself - except in error ((which this behaviour encourages)).

This behaviour occurs roughly once a week. Stopping for a while after Ctrl+Z is furiously hammered when it arrives. I'm sorry I can't offer a guaranteed reproduction. I've tried recording the behaviour but once removed it goes dormant for another week.


Original Comments

Feedback Bot on 3/26/2025, 09:24 PM:

Contributor Guide