Make explicit import suggestions more consistent#3142
Make explicit import suggestions more consistent#3142kritzcreek merged 2 commits intopurescript:masterfrom
Conversation
|
Uh. I guess I thought this got merged, not sure how it shows as having 32 commits. I guess this needs rebased? |
|
I wonder if this commit history has something to do with the 0.12 branch... I'll try to work out what's going on with that and get back to you. |
80b04b0 to
41bc81a
Compare
|
Actually seems there was only 1 commit for this PR, I think this should be back in a sensible state. |
|
I tested this manually with the following input source files, comparing the behaviour on This seems to work great; there's just one thing I noticed: module ImplicitQualifiedImport where
import Prelude
import Data.Array as M
import Data.Maybe as M
foo :: M.Maybe Unit
foo = M.Just unitsuggests using |
👍 |
|
Good spot, the ImplicitQualifiedImport suggestion should now be consistent with the others. Something I did test before and I think was missing from that gist, is checking the "maintains the form with explicitly listed data constructors if present" - ie. the case of when Updated gist here https://gist.github.com/nwolverson/f94772a141c68178acb09b68f4d41cbd |
hdgarrood
left a comment
There was a problem hiding this comment.
Ah yes, of course, thanks :)
I think this will be really nice to have! I'm happy with how this has been tested, but I'd appreciate if someone who is a little more familiar with this code could look over it before we merge, since I'm not very familiar with it, really.
|
(I'm also not familiar with this part of the code, but this looks good 👍) |
|
@garyb would you like to look over this? No rush, of course. |
|
Sure thing. I'm taking a mostly-complete break from code stuff just now, but will definitely take a look in the new year :) |
|
I've built and tested this and it works nicely, thanks! |
It's been annoying me that while either psc-ide or the suggestions for
ImplicitImport/HidingImportwill suggestBlah(..)for the import of a type and its data constructors, but other import suggestions always suggest the explicitly listed formBlah(Blah1, Blah2,...), so that the suggested imports change even when they are not relevant to the warning.e.g. when I have used
Justvs
This change instead uses the
(..)form if that was used previously, but still maintains the form with explicitly listed data constructors if present. So where I have an importimport Foo (Either(..), Maybe(Just, Nothing), zzz)(I'd like to test this, but as far as I know existing warnings tests are just testing the error code?)