Skip to content

Frequent analysis triggered when hovering over errors for non-visible,open files #1678

@DanTup

Description

@DanTup

When we hover over an error in the Problems view in VS Code, it now sends requests for code actions - which results in us calling the server for fixes/assists/availableRefactors. If the file in question is not visible (eg. not in priority files) then this results in analysis being triggered for the file, which results in errors for it being re-sent to the client. This, in turn, forces VS Code to refresh the error list, which means it flickers, and then it re-sends the request for fixes as a result.

This means that if you hover your mouse over a Problem for a non-visible file, there is a constant loop of analysis going on (and "Analyzing..." flashes in the status bar, and we burn CPU).

The underlying cause of this is similar to the .dart_tools errors issue - the server sending errors for files when it analyzes, even if they're not priority. Though interestingly in this case, the user does want the errors (since the file is in their workspace), but already has them. There's no real need for the server to re-send them here.

The fix described in dart-lang/sdk#33778 (comment) might fix this, but since it landing in a stable release of Flutter will be some way off, we may need to try and find a workaround in VS Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions