Skip to content

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

@DanTup

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.

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