-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
[Migrate diagnosticTests] part of #4173 Migrate ghcide tests to hls test utils #4207
[Migrate diagnosticTests] part of #4173 Migrate ghcide tests to hls test utils #4207
Conversation
@@ -31,9 +34,15 @@ runWithDummyPlugin' = runSessionWithServerInTmpDirCont' def dummyPlugin | |||
runWithDummyPluginAndCap :: ClientCapabilities -> Session () -> IO () | |||
runWithDummyPluginAndCap cap = runSessionWithServerAndCapsInTmpDir def dummyPlugin cap (mkIdeTestFs []) | |||
|
|||
runWithDummyPluginAndCap' :: ClientCapabilities -> (FileSystem -> Session ()) -> IO () |
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.
FWIW, I'm not sure all these functions are necessarily worth it. How bad would it be to just have the FileSystem -> Session ()
variants and then write _ -> whatever
at the use sites?
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.
Emm, we are at somewhat funny situation, that the one without the extra FileSystem are the most used.
Sure, for not frequent used ones, it would be fine we write _ -> whatever
.
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.
I guess I'm wondering how bad it would be. Otherwise we have a lot of very similar variant functions 🤔
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.
Not a blocker, anyway
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.
Yep, I mean since we have a lot of test that does not need the FileSystem
,
adding a tons of _ -> whatever
is visually bad and and not convenient for us to do the migration.
That is why I want to either do the typeclass polymorphic or just duplicate the test runner function variant.
It seems |
What's the significance of |
My guess is that so the test can trigger the typecheck manually without a lot of rules being triggered by kick and hence capture the diagnostic in a more stable way |
Two new things have been done, I modify runSessionWithServer' and ghcIde arguments to admit additional a switch for no-kick. And also some setup rearrangement. To support the migration of |
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.
Changes look generally good. Some nitpicks, and the environment variables need to be discussed!
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
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.
LGTM, thank you very much!
Only one comment nitpick and a thought :)
@@ -419,22 +435,21 @@ runSessionWithServerInTmpDir' plugins conf sessConf caps tree act = runSessionWi | |||
-- | |||
-- Note: cwd will be shifted into a temporary directory in @Session a@ | |||
runSessionWithServerInTmpDirCont :: | |||
Pretty b => | |||
-- | whether we disable the kick action or not | |||
Bool -> |
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.
This looks a little bit ad-hoc, perhaps we might want a full TestConfig
record in the future?
Just a thought, let's leave it as is, it is easy to refactor later.
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.
Yes, I am thinking about it too. perhaps tucking in things like Config, SessionConfig, ClientCapabilities
into the one TestConfig
too.
…ls-DiagnosticTests
Co-authored-by: fendor <[email protected]>
--test-no-kick
.deeply nested cyclic module dependency
runSessionWithServer'
and ghcIde arguments to admit additional a switch forno-kick
.