You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CompletionSuggestion auto-imports don't work for plugin-contributed completions #4275
The problem is that libraryUri is set and isNotImported is set to true, but it still has not 'auto import from xxx' in completion.
/// This field is omitted if getSuggestions was used rather than /// getSuggestions2. /// /// This field is omitted if this suggestion corresponds to a locally /// declared element. /// /// If this suggestion corresponds to an already imported element, then this /// field is the URI of a library that provides this element, not the URI of /// the library where the element is declared. /// /// If this suggestion corresponds to an element from a not yet imported /// library, this field is the URI of a library that could be imported to /// make this suggestion accessible in the file where completion was /// requested, such as package:foo/bar.dart or /// file:///home/me/workspace/foo/test/bar_test.dart.String? libraryUri;
/// True if the suggestion is for an element from a not yet imported library. /// This field is omitted if the element is declared locally, or is from /// library is already imported, so that the suggestion can be inserted as /// is, or if getSuggestions was used rather than getSuggestions2.bool? isNotImported;
changed the title [-]CompletionSuggestion not support auto import from library in vscode[/-][+]CompletionSuggestion auto-imports don't work for plugin-contributed completions[/+]on Nov 23, 2022
Activity
[-]CompletionSuggestion not support auto import from library in vscode[/-][+]CompletionSuggestion auto-imports don't work for plugin-contributed completions[/+]DanTup commentedon Nov 23, 2022
I have a fix for review at https://dart-review.googlesource.com/c/sdk/+/271701.
This change is in the Dart SDK so (once merged) the fix will only show up in a future Dart SDK release (and not a VS Code extension release).
[analysis_server] Fix auto-imports not working for plugin completions
DanTup commentedon Nov 23, 2022
This is fixed by dart-lang/sdk@019fb7a and will ship in a future release of the Dart SDK. If you need to test this sooner, you could use a dev SDK from https://dart.dev/get-dart/archive#dev-channel once the release date shown is newer than todays date.