dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.12k stars 1.57k forks source link

Crash while trying to find the compilation unit for an element #56070

Open bwilkerson opened 3 months ago

bwilkerson commented 3 months ago

The following crash occurred while trying to find the compilation unit for an element:

StateError: Bad state: No unit: as prefix0
at _getUnitElement  (protocol_server.dart:303)
at newLocation_fromElement  (protocol_server.dart:191)
at convertElement   (protocol_dart.dart:33)
at addDartOccurrences.<fn>  (occurrences_dart.dart:18)
at _LinkedHashMapMixin.forEach  (dart:collection)
at addDartOccurrences   (occurrences_dart.dart:16)
at DocumentHighlightsHandler.handle.<fn>    (handler_document_highlights.dart:41)
at ErrorOrRecord2Extension.mapResults   (error_or.dart:125)
at DocumentHighlightsHandler.handle (handler_document_highlights.dart:39)
at <asynchronous gap>   (async)
at ServerStateMessageHandler.handleMessage  (handlers.dart:397)
at <asynchronous gap>   (async)
at LspAnalysisServer._handleRequestMessage  (lsp_analysis_server.dart:1022)
at <asynchronous gap>   (async)
at LspAnalysisServer.handleMessage.<fn>.<fn>    (lsp_analysis_server.dart:477)
at <asynchronous gap>   (async)
at OperationPerformanceImpl.runAsync    (operation_performance.dart:174)
at <asynchronous gap>   (async)
at LspAnalysisServer.handleMessage.<fn> (lsp_analysis_server.dart:460)
bwilkerson commented 3 months ago

@scheglov