Skip to content
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

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

Closed
DanTup opened this issue May 27, 2020 · 1 comment
Closed

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

DanTup opened this issue May 27, 2020 · 1 comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented May 27, 2020

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.

@DanTup DanTup added is bug in editor Relates to code editing or language features labels May 27, 2020
@DanTup DanTup added this to the v3.12.0 milestone May 27, 2020
@DanTup DanTup modified the milestones: v3.12.0, On Deck Jun 22, 2020
@DanTup DanTup modified the milestones: On Deck, Backlog Jul 2, 2020
@DanTup DanTup modified the milestones: On Deck, v3.16.0 Oct 1, 2020
@DanTup
Copy link
Member Author

DanTup commented Oct 21, 2020

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

@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Oct 21, 2020
@DanTup DanTup closed this as completed Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

1 participant