Skip to content

Qualify imported names plugin #2355

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

Merged
merged 45 commits into from
Nov 29, 2021
Merged

Qualify imported names plugin #2355

merged 45 commits into from
Nov 29, 2021

Conversation

eddiemundo
Copy link
Collaborator

@eddiemundo eddiemundo commented Nov 15, 2021

qualify-imported-names-demo

Purpose

If you have unqualified names imported by a unqualified import and you want to qualify them, this plugin can do it.

Usage

  1. Put cursor over the import declaration you want to qualify names from.
  2. Initiate a Code Action.
  3. Select Qualify imported names.

Features

  • Names are qualified on a per-import declaration basis.
  • Names are qualified by the imported module's alias if it has one, otherwise by the imported module's name.
  • If the import declaration has an explicit import list then the plugin will qualify only names on the list.
  • If the import declaration has an explicit hiding list then the plugin will qualify names from the imported module that are not on the list.

I think this plugin is complete but I'm uncertain about GHC 9+.

@jneira jneira requested a review from Ailrun November 16, 2021 10:01
@jneira
Copy link
Member

jneira commented Nov 16, 2021

First of all many thanks for working on this useful feature. Will do a review asap.
I wonder if all functionality about imports should live in one unique plugin, we will have 3 plugins about and seems to me that would be time to unify them.
It is a general consideration and it should be done in another pr if we consider it makes sense.

Hard to believe but i've not found any issue about this feature. It is not required but if someone knows any of the issues are related with this please note it

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

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

lgtm the plugin look really great
could you update the features documentation adding it as well, thanks!

@jneira
Copy link
Member

jneira commented Nov 24, 2021

Will merge after releasing 1.5.1, thanks for your patience 🙂

@jneira jneira added merge me Label to trigger pull request merge and removed merge me Label to trigger pull request merge labels Nov 28, 2021
@jneira jneira added the merge me Label to trigger pull request merge label Nov 29, 2021
Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

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

sorry, I ve just observed the .cabal file does not include the readme and test data files in source-extra-files, take a look to other plugins .cabal to see the glob syntax available
thanks

@jneira jneira removed the merge me Label to trigger pull request merge label Nov 29, 2021
@eddiemundo
Copy link
Collaborator Author

sorry, I ve just observed the .cabal file does not include the readme and test data files in source-extra-files, take a look to other plugins .cabal to see the glob syntax available thanks

I looked at some of the other plugins and they don't seem to include the README.md or gif, but I included them anyway.

@jneira
Copy link
Member

jneira commented Nov 29, 2021

I looked at some of the other plugins and they don't seem to include the README.md or gif, but I included them anyway.

yeah you are right, we have to eventually add it in the rest of plugins, thanks for doing it for this one

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for this nice plugin

@jneira jneira added the merge me Label to trigger pull request merge label Nov 29, 2021
@mergify mergify bot merged commit d0ccc2f into haskell:master Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants