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
Completion for @override doesn't work well at the end of a class #3182
Describe the bug
DartCode is over-eager to offer class autocompletions to attributes. See the screenshot: here it should ideally be offering me @override as the completion, rather than trying to auto-import random classes from dart:io :)
To Reproduce
Create a class, attempt to add an override (e.g. toString())
Expected behavior
Either offer me autocomplete for available attributes, or don't offer me autocomplete. The proffered choices will always create a syntax error.
Screenshots
Versions (please complete the following information):
I think this is the same as dart-lang/sdk#32677 and/or dart-lang/sdk#42266. Given the code above, the parser doesn't create an annotation (annotations are normally attached to other nodes, but there isn't on here) so the completion doesn't have the right context and produces bad results.
I think it will require some parser changes (perhaps to create a synthetic element to attach the annotation to) in order to fix.
Closing this as a dupe of dart-lang/sdk#42266. If I insert a method below, then the completion works as expected, so it's definitely restricted only to where there isn't a node for the annotation.
changed the title [-]@override has conflicting autocomplete with LSP[/-][+]Completion for @override doesn't work well at the end of a file/class[/+]on Mar 8, 2021
The issue I closed this as a dupe of (completing the method names) was fixed, but it didn't resolve this issue (completing an annotation itself at the end of the class).
changed the title [-]Completion for @override doesn't work well at the end of a file/class[/-][+]Completion for @override doesn't work well at the end of a class[/+]on Aug 23, 2022
Activity
DanTup commentedon Mar 7, 2021
I think this is the same as dart-lang/sdk#32677 and/or dart-lang/sdk#42266. Given the code above, the parser doesn't create an annotation (annotations are normally attached to other nodes, but there isn't on here) so the completion doesn't have the right context and produces bad results.
I think it will require some parser changes (perhaps to create a synthetic element to attach the annotation to) in order to fix.
DanTup commentedon Mar 8, 2021
Closing this as a dupe of dart-lang/sdk#42266. If I insert a method below, then the completion works as expected, so it's definitely restricted only to where there isn't a node for the annotation.
[-]@override has conflicting autocomplete with LSP[/-][+]Completion for @override doesn't work well at the end of a file/class[/+]DanTup commentedon Aug 23, 2022
The issue I closed this as a dupe of (completing the method names) was fixed, but it didn't resolve this issue (completing an annotation itself at the end of the class).
[-]Completion for @override doesn't work well at the end of a file/class[/-][+]Completion for @override doesn't work well at the end of a class[/+][analysis_server] Include annotation completions at end of class
DanTup commentedon Aug 24, 2022
Fixed by dart-lang/sdk@ece330a.