Open asashour opened 2 years ago
That probably isn't the right solution. We should investigate to see why a DynamicElement
is being suggested. It looks like the code is looking at the names that are declared in dart:core
, and is finding one associated with the declaration of dynamic
. There shouldn't be such a mapping. The real issue appears to not be in the code completion contributor, but in the way recovery is being done in that sample of code.
There is a test case in IntelliJ plugin for
completion.getSuggestions
, for completingimport 'dart:core' show prin
This used to work, but fails after https://github.com/dart-lang/sdk/commit/c9c4aa5b25d5a64b6bd9ec8287c5a8f1fb668726#diff-2e4c5d5cea7e48adddaaccc1bea6a662cd66cd61fc0449bb5ed46b7c994f4e0bR508, giving a server-side error and a client-side timeout.
The reason is the
DynamicElement
not handled. I guess this should be fixed, by addingdynamic
as a suggested option.equivalent test case for 'get_suggestions_test.dart'
```dart FutureError
```dart 1634536428720:Ex:Failed to handle completion domain request:: completion.getSuggestions Invalid argument(s):: Cannot suggest a DynamicElementImpl #0 SuggestionBuilder.suggestElement (package::analysis_server/src/services/completion/dart/suggestion_builder.dart::393::7) #1 CombinatorContributor.computeSuggestions (package::analysis_server/src/services/completion/dart/combinator_contributor.dart::29::21) #2 DartCompletionManager.computeSuggestions.