dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
500 stars 191 forks source link

Wrong completion matches temporarily #9802

Open Peter-Juhasz opened 9 months ago

Peter-Juhasz commented 9 months ago

Version: 17.9.0 P2.1

For the request p, the wrong completion (AbandonedMutexException) is selected temporarily instead of the obvious one (p lambda expression parameter). After a short time, the right one gets selected, but you can see on the video that the wrong completion is temporarily gets selected:

https://github.com/dotnet/razor/assets/9047283/a456d594-479c-4468-9991-8d541cd3705c

This can be frustrating when I just type continuously (in this case p) and get a random completion activated (on ) because a wrong completion was selected):

https://github.com/dotnet/razor/assets/9047283/00b9a369-fde4-47bf-aedc-a26039c2d2b0

May be related to #9724 #9725 in terms of there are obviously timing issues somewhere in the system.

Peter-Juhasz commented 9 months ago

This is a shorter repro, o matches #region first and then object:

https://github.com/dotnet/razor/assets/9047283/4948155e-06e4-4f41-9a5d-03cf461b4218

Peter-Juhasz commented 9 months ago

This is another case when I try to type out and get AccountLayout committed by a random completion:

https://github.com/dotnet/razor/assets/9047283/bf3ca6f5-003c-40fa-b7f5-8c46aa6782b9

It feels like (in same cases) selecting completions are late by at least a few hundred milliseconds for each character. May not be clearly visible on this recording, but I can see the selection jumping in the completion session as I type character by character. Unless I type like super slow (and wait for the right completion to be matched), I get a random completion activated, which is quite frustrating.

Dean-NC commented 4 months ago

The issue of typing a HTML tag or attribute fast, and pressing tab to accept the 1st intellisense item, and getting the wrong tag put in happens regularly for me in .cshtml files. It's so annoying. After it happens, most of the time it won't repeat the problem for that same tag at that same editor location, meaning it works after erasing it and re-typing/tabbing. But sometimes after it happens and I erase and slowly re-do it, I can see that intellisense doesn't have that item in the list, and I have to type the full thing without being able to press tab.

Peter-Juhasz commented 3 months ago

Type if, and get completed with IFormatProvider (happens the most frequently):

https://github.com/dotnet/razor/assets/9047283/edd45be0-a656-4753-ac99-e2b461dc51cd

Dean-NC commented 2 months ago

I run into this constantly. It's also when typing CSS in a razor page, in a <style> block. I opened a .cshtml page, waited for a few minutes, then in an existing <style> block, I added padding: 2rem; and when I typed the semi-colon it erased the 2rem and put some random non-CSS thing in. I removed the strange value and re-typed the 2rem; and it was OK then.

In the same page, after the CSS problem, I typed the HTML: <section and when I pressed the spacebar, it changed section to cache.

I've used every version of Visual Studio since it came out in the late 1990's. I've never seen it handle fundamental things like typing and syntax colorization so poorly.