-
Notifications
You must be signed in to change notification settings - Fork 300
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
Organise imports places @Timeout in the wrong position #3598
Comments
@bwilkerson the
Would this be the best way to determine whether the annotation should be anchored to the top? I'm assuming it's not possible to have a single unused import (that would leave nowhere for the annotation to go), as you'd need to always either by importing the file containing the annotation, or if the annotation is in the current file, importing the |
I can't think of any better way.
Not a single unused import that's annotated with something from meta. You could certainly have an unused import that's annotated with an annotation that's defined locally:
In that case the annotation won't have a |
…rting directives Fixes Dart-Code/Dart-Code#3598.
… organizing imports + handle comments between the last annotation and the directive code. Fixes Dart-Code/Dart-Code#3598. Change-Id: I868c832c8fcb2bf67aab83400ef2e57a5f14ce45 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219783 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This should be fixed with dart-lang/sdk@445ac5d. It's a change in the SDK rather than Dart-Code so will show up with an SDK release. |
If you are using the test package you are able to add an @timeout annotation to the top of a library to indicate a longer than default timeout for the tests.
The @timeout annotation MUST be at the top of the file.
If you have the @timeout annotation and run 'Organise Imports' the @timeout annotation often gets moved down in amongst the imports and in some cases is completely deleted.
This causes an error an you have to manually move the annotation back to the top of the file or worse still removes it all together and if it is deleted you may not even realise it has been deleted.
Delete Example
In this example 'dart:io' is an unused package. Running organise imports removes dart:io and also @timeout
After organize imports:
Move example
The 'dart:io' package is in the wrong place
In this scenario the @timeout annotation ends up:
Not exactly a critical bug, but annoying.
The text was updated successfully, but these errors were encountered: