-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Extract the pre-decl pragma parsing to its own module #2428
Extract the pre-decl pragma parsing to its own module #2428
Conversation
…ge-server Keep up to date with master.
…code, rename NextPragma to NextPragmaInfo, add getNextPragmaInfo function
…ge-server into extract-predecl-comments-parser
…eddiemundo/haskell-language-server into extract-predecl-comments-parser update
Many thanks for the refactoring: it makes sense to me but i would like to know @pepeiborra thoughts about the chosen place and name |
Unless you are planning to use this in ghcide, it doesn't seem like a good idea to move it in. In my view code should be moved out of ghcide where possible, in order to shrink the core surface that needs to be maintained and updated. |
hmm ok, so we should looking for another place to put this kind of code, useful for several plugins, depending on ghcide and no suitable to be in ghcide itself 🤔 |
alternatives:
thoughts @pepeiborra? |
What's the problem with plugins depending on each other?
|
Well, if the code is generic enough (and we should encourage so), it would not fit naturally in any concrete plugin and will be less discoverable to be used in other ones.
I was thinking in the better place to put it even if it needs more maintainer work. It is one package more between the bunch of existing ones. |
The main reason I thought putting this somewhere into its own module was necessary is because the pragmas plugin depends on ghcide, and so if something in ghcide needs some pragmas plugin functionality then there would be a cyclic dependency and it wouldn't work. This might not be the case? |
That's why I said:
Are you planning to use this in ghcide then? If not, best left in the pragmas plugin. |
Oh, yeah, there is an import placement bug outlined in the tests in #2425 that can be solved using functionality in the pragmas plugin, otherwise we'd have to duplicate the logic, or solve it in a different way. The import placement stuff is done in CodeAction.hs which is in ghcide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the refactoring
The purpose is so that it can be reused by multiple plugins, and ghcide.