-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor went and remained in a completely out of sync/broken state #10759
Comments
@Peter-Juhasz is this just all the time in 17.12? Or is it intermittent. Does closing and re-opening the Razor file fix the issue? If its all the time, the best course of action would be to report using VS Feedback, and include a recording so we can see whats going on. I seem to remember that perhaps your company does not allow you to do that? If so, perhaps you could increase the log level for Razor (Tools -> Options -> Text Editor -> Razor -> Advanced -> Output Window Log Level, set to "Debug") and include the content of the output window in the logs? The logs would contain file paths though, so if need be, you could email them to me (david.wengier at microsoft.com) if you don't want to post them on GitHub. |
It doesn't happen all the time, it just happened yesterday. Unfortunately, I don't know how to reproduce it - I did not do anything suspicious. But thought it would be worth to report. Reopening the file/editor resolved the issue. Oh, I didn't know there is an option to increase the Razor log level. I'm going try to collect lower-level logs next time I encounter either this or another issue. |
Thanks for confirming. The issue you're seeing is a symptom of Razor and Roslyn being out of sync, and there are some fixes on the platform side and Razor side in the works that will hopefully help, but it's the type of thing where there are numerous root causes. |
Open files got unusable again, here are the logs @davidwengier, hope it helps: (I cleared the logs first to make sure they belong exclusively to that open tab.)
|
It got completely unusable again: Some more logs (Debug level):
|
It keeps doing that after working on a file for like 30 minutes, makes work quite difficult. |
Bad news: The logs you've attached, whilst appreciated, don't really show anything useful I do at least have something I can debug now though, the only risk of course is that the issue I have found, and will hopefully fix, is not the same as the same one you are running in to. Only time will tell there. Also worth noting that closing and re-opening the file always fixes things for me. |
@davidwengier I was finally able to find a consistent repro yesterday, it is not time dependent. Here you go, type a Kepernyofelvetel.2024-08-26.090415.mp4@page "/counter"
@rendermode InteractiveServer
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount$$</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
} |
Great news, that's the exact repro I found too! It's the result of a system called "provisional completion", where the "." is Html (the end of a sentence) but then you type the next character and now the "." has to become C#, and we hit a sync issue with Roslyn as we frantically try to update the generated C# document while completion is happening. There is a PR on the editor side that has that I'm hoping will fix the issue, but it hasn't been merged into VS yet. Hoping to follow up tomorrow when America wakes up. |
Found the problem! Classic bug, easiest mistake to make. A parameter changed from a character offset to a length: |
Verified this issue does not repro in VS 17.12 Preview 2 now |
VS 17.12.0 P1
All services broken/out of sync:
Rogzites.2024-08-18.171425.mp4
Did not resolve after typing.
No logs in Razor Logger Output.
The text was updated successfully, but these errors were encountered: