Skip to content

Conversation

alanz
Copy link

@alanz alanz commented Nov 5, 2019

So it can be used in standalone plugins, like HaRe

-- ---------------------------------------------------------------------

runWithContext :: Monoid a => Uri -> IdeGhcM (IdeResult a) -> IdeGhcM (IdeResult a)
runWithContext uri act = case uriToFilePath uri of
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not really a fan of this function because it calls error. Is there an issue using runActionWithContext?

Why you would ever want to use this function should be documented anyway as I don't think it should ever be used in the h-i-e code base.

Copy link
Author

Choose a reason for hiding this comment

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

This function was moved here from the test/unit/HaRePluginSpec.hs, so that it can be available for use in other modules, and is used in HaRe for running refactors.

I will see what other options we have.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Clearly documenting it's purpose and intended usage is fine in my opinion. It mainly should be clear, that neither hie, nor hie-plugin-api is allowed to really use this function.

@fendor fendor mentioned this pull request Nov 14, 2019
26 tasks
@alanz alanz closed this Nov 20, 2019
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.

3 participants