Skip to content

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

Closed

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.

Activity

  1. changed the title [-]Frequent analysis triggered when hovering over errors for non-visible files[/-] [+]Frequent analysis triggered when hovering over errors for non-visible/not-open files[/+] on May 3, 2019
  2. added this to the v2.27.0 milestone on May 3, 2019
  3. added a commit that references this issue on May 6, 2019
    99a84fa
  4. skybur commented on May 8, 2019

    @skybur

    When will the workaround be released? Currently I restarted VSCode everytime the "analyzing" not stopping happened and that really wastes my time. Or is there a way to restart the dart server without restarting VSCode? Thank you.

  5. DanTup commented on May 8, 2019

    @DanTup
    MemberAuthor

    @skybur unless you've hovering your mouse over an open - but not visible - file in the Problems view and leaving it there, your issue won't be the same thing (and the workaround won't help). Please open a new issue with some details (and ideally a log) and we can try and track down what's happening. Thanks!

  6. changed the title [-]Frequent analysis triggered when hovering over errors for non-visible/not-open files[/-] [+]Frequent analysis triggered when hovering over errors for non-visible,open files[/+] on May 8, 2019
  7. added a commit that references this issue on May 15, 2019
    2665ce1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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