-
Notifications
You must be signed in to change notification settings - Fork 29
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
Allow apply refactorings to an already parsed module #91
Comments
Sounds good, happy to do this. (Language.Haskell.GHC.ExactPrint.Anns, Located (HsModule GhcPs)) work for you?
Totally agree. |
Many thanks for take care 😃
Sounds good, we already have |
Correct, |
It is done in #98 |
@jneira It just occurred to me that for this to work, your I'll fix the other bugs you reported in the next few days but this is the best that can be done at the moment. I did plan to work on alanz/ghc-exactprint#93 once I get more bandwidth but the pandemic has made it difficult. |
thanks for your great work |
OK, sounds good. I'll put it in then. |
Merged #100 |
Hi, we added recently hlint support in haskell-language-server, including the apply of refactorings usgins appy-refact, via
applyRefactorings
The actual integration could be improved if the api would expose a function to apply them to an already parsed module.
Now we have to use a temporary file and ask apply-refact to parse it again:
As we are using ghc-lib to parse for ghc < 8.10 and the real ghc for 8.10, following hlint, maybe only we can take advantage in the latter path, but i think it still will worth it.
Refact.Internal.runRefactoring
is exposed but maybe a higher endpoint, closer toapplyRefactorings
would be handy for downstream packages.For ghc < 8.10 we will continue to need delegate the parsing to apply-refact. In that case it would be handy be able to inform the parser option, to, for example, pass custom language extensions not included in the module as pragmas.
Let me know if you think that should be in another issue.
//cc @ndmitchell @alanz
The text was updated successfully, but these errors were encountered: