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

Implement 'organize imports' functionality #142

Merged
merged 8 commits into from
Jan 2, 2023
Merged

Implement 'organize imports' functionality #142

merged 8 commits into from
Jan 2, 2023

Conversation

rvanasa
Copy link
Contributor

@rvanasa rvanasa commented Jan 2, 2023

Sorts and groups Motoko imports on pressing the "Organize imports" key binding.

Here is an overview of the current grouping and sorting rules:

  • Sort alphabetically by path, import name, and then field name
  • Move named module imports above explicit field imports for the same path
  • Group by prefix (ic:, canister:, mo:, and then relative paths)

TODO:

  • Automatically remove unused imports

Progress towards #123.

@rvanasa rvanasa merged commit c28a140 into master Jan 2, 2023
@rvanasa rvanasa deleted the ryan/dev branch January 2, 2023 20:52
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.

1 participant