-
-
Notifications
You must be signed in to change notification settings - Fork 387
HLS does not suggest Data.ByteString.Internal for possible imports #3369
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
Comments
I think |
I have also bitten by this feature; this logic also filters out local |
It makes most sense to have Internal modules as the lowest priority imports, and then only show them when we can't reach the maximum number of imports, imo... |
I think @pepeiborra is the proponent of this feature. |
I implemented completions for non-imported modules here: #2040 Internal modules were filtered out because at that time we didn't have a system for sorting completions by importance, and I am not keen on adding user options for something like this. Contributions are welcome to change and improve the current behaviour. |
I'm reading that as you saying that you'd be okay with a PR that re-introduced these completions so long as they were sorted to the bottom? |
For what it's I would be in favor of removing all filtering based on sentinel string values even without implementing import ranking. I think it's too fragile of a convention - sometimes |
I would support improving the heuristic, or replacing the filtering with ranking as suggested, but removing it would probably lead to more tickets complaining about internal modules showing up in import lists unexpectedly. CC @fendor |
I agree with pepe, removing the heuristic is probably a bad idea, but ranking them at the very bottom might be an OK middle ground. We did have the completions, and devs started importing the wrong modules more easily, and beginners can't really tell what the contract is of I agree that filtering on String values is a sub-par solution, but I think currently the benefits for beginners outweighs the drawback for advanced users.
That is actually something we can fix, right? Iirc, we know whether a module is from this package or a third-party dep. |
GHC 9.2.4
HLS 1.8
I write the following in a file:
foo = c2w
Expected behavior is a code action for importing
c2w
fromData.ByteString.Internal
, instead I receive no hint...The text was updated successfully, but these errors were encountered: