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

[WIP] "Replace with type synonym" action #1515

Closed
wants to merge 14 commits into from
Closed

[WIP] "Replace with type synonym" action #1515

wants to merge 14 commits into from

Conversation

mpardalos
Copy link
Contributor

@mpardalos mpardalos commented Mar 7, 2021

Adds an action to replace instances of the RHS of type synonyms in a type with their equivalent type synonym.

Also adds some tests for the retrie plugin.

Addresses #506

@mpardalos mpardalos changed the title "Replace with type synonym" action (WIP) [WIP] "Replace with type synonym" action Mar 7, 2021
@pepeiborra
Copy link
Collaborator

Can you attach some description and/or screenshots showing how this feature works?

The retrie plugin already offers code actions to fold and unfold type synonyms, isn't that what you want?

image

@mpardalos
Copy link
Contributor Author

mpardalos commented Mar 8, 2021

I don't yet have the feature working, I just opened this PR to declare I'm working on the issue, once I have some screenshots I will attach them here. I can close the PR and reopen once the feature is actually working if that is how it's usually done.

This PR is closely related to that feature but it's about adding that hint to the use site, in order to fold one instance of a type synonym. It should be useful for synonyms that come from libraries.

@mpardalos
Copy link
Contributor Author

Part of the work of the feature is done. You can apply type synonyms at single usage sites.

usage

What remains is to only suggest relevant type synonyms. We are currently suggesting any type synonym in scope, even though the relevant action does nothing.

@mpardalos
Copy link
Contributor Author

mpardalos commented Apr 1, 2021

The plugin will now only suggest relevant type synonyms:

example2

What remains now is to include suggestions for imported type synonyms, which would probably be the most useful.

@jneira jneira linked an issue Dec 16, 2021 that may be closed by this pull request
@michaelpj
Copy link
Collaborator

Closing as dead.

@michaelpj michaelpj closed this Nov 2, 2022
@michaelpj michaelpj added the status: unfinished Status for PRs that have been semi-abandoned label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: unfinished Status for PRs that have been semi-abandoned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestions or actions to use type synonyms
3 participants