-
Notifications
You must be signed in to change notification settings - Fork 714
Ignore updates with no changes for csharp files #8162
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Say verbose logging was enabled. How many of these requests are we talking about?
~9x |
Will definitely notice that in the log |
@@ -189,7 +190,7 @@ export class RazorDocumentManager implements IRazorDocumentManager { | |||
} | |||
} | |||
|
|||
this.notifyDocumentChange(document, RazorDocumentChangeKind.closed); | |||
this.notifyDocumentChange(document, RazorDocumentChangeKind.closed, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentionally leaving these empty. For open/close/add/remove the changes are irrelevant.
@@ -40,7 +40,7 @@ export class DynamicFileInfoHandler { | |||
} | |||
); | |||
this.documentManager.onChange(async (e) => { | |||
if (e.kind == RazorDocumentChangeKind.csharpChanged && !e.document.isOpen) { | |||
if (e.kind == RazorDocumentChangeKind.csharpChanged && !e.document.isOpen && e.changes.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the change that reduces updates. Even if our version is bumped as long as the csharp text didn't change no point in sending a notification to Roslyn
@@ -40,7 +40,7 @@ export class DynamicFileInfoHandler { | |||
} | |||
); | |||
this.documentManager.onChange(async (e) => { | |||
if (e.kind == RazorDocumentChangeKind.csharpChanged && !e.document.isOpen) { | |||
if (e.kind == RazorDocumentChangeKind.csharpChanged && !e.document.isOpen && e.changes.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for walking through this with me offline! Since it's perf sensitive, consider adding a comment here to describe the conditions that we don't want to update the dynamic file info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the issue on aspire for me
/backport to release |
Started backporting to release: https://github.com/dotnet/vscode-csharp/actions/runs/14393236954 |
Before #7826 razor would use textdocument/{open, changed, closed} for csharp changes. That would mean that if the text didn't actually change vs code wouldn't notify roslyn. After that change the notification is handled for closed files by the razorDocumentManager. This causes a loop where csharp generated -> workspace changed for generated csharp -> workspace listeners notifies change -> generation is queued -> change is reported -> workspace changed for csharp -> ....
This is a quicker fix to hopefully unblock while I investigate a more comprehensive fix on the razor side