-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove unnecessary import
assist should take empty lines into consideration
#56761
Comments
Summary: The "Remove unnecessary import" assist should remove empty lines after the last import is removed, ensuring consistency with auto-import behavior and preventing unnecessary empty lines in the code. |
Can you explain what you mean by "the markdown removes it"? |
If I leave empty lines at the start of the markdown they get trimmed. |
I don't understand what markdown. I don't see any markdown text, nor reference to a markdown tool. |
Sorry, adding a code block like the above using ` is a markdown feature. This is what I meant by "markdown". Leaving empty lines at the start of a code block is not possible because they get trimmed. The point of the comment was to show "There should be one more empty line here" but that wasn't possible since they were getting trimmed. I can update the description. I'm just not sure if they get trimmed by default or by GH, but in this case, it doesn't matter, I don't think. EditEdited the description for more clarity. Nice catch @srawlins! |
Ahhhhhhh, my mind is open. Thank you @FMorschel I know what you mean. (I have had this problem trying to put single backticks in single backticks in GitHub markdown comment boxes.) Everything makes sense to me now; I get the request. 😁 |
The
Remove unnecessary import
(unused as well) assist should take empty lines into consideration.Since the auto import takes that into account to separate
package
imports from local imports (etc) by adding a line in between, this should also remove them as well. Also, I would expect that the last import being removed would remove all lines until the next thing written on the file:Today when running that assist/quick-fix:
I would expect at least the second line to be removed here.
PS: I noticed this inside the SDK when deving a new assist, I had a
dart
import and then when removing it I was left with the copyright lines at the top and two new empty lines between them and thepackage
imports.// CC: @DanTup
The text was updated successfully, but these errors were encountered: