Skip to content

Hovering over an error sends repeated requests for quick fixes #2500

Closed

Description

@DanTup

This happened in sdk/pkg/analysis_server/test/lsp/diagnostic_test.dart:

repeated-quick-fix-requests

As part of requesting fixes, we're getting analysis.errors notifcations, which likely refreshes the error list, which causes VS Code to ask again. There's supposed to be some protection against this though:

[5:22:22 PM] [Analyzer] [Info] ==> {"id":"2016","method":"edit.getFixes","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analysis_server/test/lsp/diagnostic_test.dart","offset":4559},"clientRequestTime":1590596542770}
[5:22:22 PM] [Analyzer] [Info] <== {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
[5:22:22 PM] [Analyzer] [Info] <== {"event":"analysis.errors","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","errors":[{"severity":"INFO","type":"TODO","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart",
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.occurrences","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","occurrences":[{"element":{"kind":"CLASS","name":"JsonDecoder","location":{"file":"/Users/danny/Dev/Dart SDKs/nightly-2020-05-27/lib/convert/json.dart
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.closingLabels","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","labels":[]}}
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.folding","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","regions":[{"kind":"FILE_HEADER","offset":76,"length":313},{"kind":"CLASS_BODY","offset":816,"length":1485},{"kind":"DOCUMENTATION_COMMENT","offset":624,"
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.outline","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name":"<unit>","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plu
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.errors","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","errors":[{"severity":"INFO","type":"TODO","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart",
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.occurrences","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","occurrences":[{"element":{"kind":"CLASS","name":"JsonDecoder","location":{"file":"/Users/danny/Dev/Dart SDKs/nightly-2020-05-27/lib/convert/json.dart
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.closingLabels","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","labels":[]}}
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.folding","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","regions":[{"kind":"FILE_HEADER","offset":76,"length":313},{"kind":"CLASS_BODY","offset":816,"length":1485},{"kind":"DOCUMENTATION_COMMENT","offset":624,"
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.outline","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name":"<unit>","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plu
[5:22:23 PM] [Analyzer] [Info] <== {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
[5:22:23 PM] [Analyzer] [Info] <== {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.errors","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","errors":[{"severity":"INFO","type":"TODO","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart",
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.occurrences","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","occurrences":[{"element":{"kind":"CLASS","name":"JsonDecoder","location":{"file":"/Users/danny/Dev/Dart SDKs/nightly-2020-05-27/lib/convert/json.dart
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.closingLabels","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","labels":[]}}
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.folding","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","regions":[{"kind":"FILE_HEADER","offset":76,"length":313},{"kind":"CLASS_BODY","offset":816,"length":1485},{"kind":"DOCUMENTATION_COMMENT","offset":624,"
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.outline","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name":"<unit>","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plu
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.errors","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","errors":[{"severity":"INFO","type":"TODO","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart",
[5:22:23 PM] [Analyzer] [Info] <== {"id":"2016","result":{"fixes":[{"error":{"severity":"ERROR","type":"STATIC_TYPE_WARNING","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analysis_server/test/lsp/diagnostic_test.dart","offset":4559,"length":14,"startLine":133,"startColumn":52},"message":"The method 'toNotificat
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.occurrences","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","occurrences":[{"element":{"kind":"CLASS","name":"JsonDecoder","location":{"file":"/Users/danny/Dev/Dart SDKs/nightly-2020-05-27/lib/convert/json.dart
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.closingLabels","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","labels":[]}}
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.folding","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","regions":[{"kind":"FILE_HEADER","offset":76,"length":313},{"kind":"CLASS_BODY","offset":816,"length":1485},{"kind":"DOCUMENTATION_COMMENT","offset":624,"
[5:22:23 PM] [Analyzer] [Info] <== {"event":"analysis.outline","params":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plugin/lib/protocol/protocol_common.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name":"<unit>","location":{"file":"/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analyzer_plu
[5:22:23 PM] [Analyzer] [Info] <== {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}

It also looks like we might be triggering some other duplicate work here as the errors are coming back multiple times.

Activity

  1. added this to the v3.12.0 milestone on May 27, 2020
  2. modified the milestones: v3.12.0, On Deck on Jun 22, 2020
  3. modified the milestones: On Deck, Backlog on Jul 2, 2020
  4. modified the milestones: On Deck, v3.16.0 on Oct 1, 2020
  5. DanTup commented on Oct 21, 2020

    @DanTup
    MemberAuthor

    Can't repro, but suspect this was a dupe of dart-lang/sdk#42994.

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 featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions