Skip to content
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

Add action to move imports to top of module #3413

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

giacomocavalieri
Copy link
Member

@giacomocavalieri giacomocavalieri commented Jul 19, 2024

This PR closes #3186

I also moved this action and the tuple one to their own module because it was starting to feel a bit overwhelming to have everything in the actions module. If you don't like this I can put everything back to just that file though!

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've left a few notes inline as I think we need to cover things like import grouping and comments.

Ideally the splitting would have been in its own PR. Having two things in one PR means one will get held back by the other and it's hard to review.

compiler-core/src/language_server/engine.rs Outdated Show resolved Hide resolved
compiler-core/src/language_server/engine.rs Show resolved Hide resolved

pub fn main() {}

import result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the imports are lower but in groups? Do the groups get preserved?

What about comments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmh this is quite tricky, basically I'd have to reimplement part of the pretty printer here but I'm not a fan of that... I'll have to think a bit more how to approach this

@lpil lpil marked this pull request as draft July 19, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LSP Action: Move all imports to the head for the module
2 participants