-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Refactor hls-test-util and reduce getCurrentDirectory after initilization #4231
Refactor hls-test-util and reduce getCurrentDirectory after initilization #4231
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@@ -848,7 +846,7 @@ getModIfaceFromDiskAndIndexRule recorder = | |||
hie_loc = Compat.ml_hie_file $ ms_location ms | |||
fileHash <- liftIO $ Util.getFileHash hie_loc | |||
mrow <- liftIO $ withHieDb (\hieDb -> HieDb.lookupHieFileFromSource hieDb (fromNormalizedFilePath f)) | |||
hie_loc' <- liftIO $ traverse (makeAbsolute . HieDb.hieModuleHieFile) mrow |
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.
The doc said hieModuleHieFile would return a full path, I guess it is not necessary to absolute it.
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'm unsure about this sort of thing. If we need it to be absolute then I think it can be sensible to absolutize it just to be sure... since we don't track it in the types or anything.
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.
Perhaps we should also introduce an abstraction that tracks whether we expect a path to be absolute or relative?
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.
Seems like a good idea, some places we might need this.
path from [ghc, hiedb, lsp client, cradle].
The ones from ghc should depend on how we load the file into ghc
in sessionloader?
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.
It is quite a mess in our codebase, we might need to open an issue and try to sweep and standardize them.
Stan is blocking
----------------update Same for hlint, will shift to root only for these test |
This reverts commit 042df98.
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
Again, thank your for the reviews and suggestions, expecially since this PR contains a lot of changes, you have done me a great favor of tracking everything down ! I could not do it without your help. |
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.
Just some more attention to the Note
, I still don't quite get the LSP root
thingy, where does this affect us?
-- But according to https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_workspaceFolders | ||
-- The root dir is deprecated, but we still need this now, | ||
-- since a lot of places in the codebase still rely on it. |
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.
Sorry, I don't quite get this, which root dir
is this now?
Co-authored-by: fendor <[email protected]>
Co-authored-by: fendor <[email protected]>
That might not be possible unless we have everything adapted to it, things like hlint and evaluation of template haskell. I'll add this to the note too. |
I think we might want to seriously consider using one of the typed path libraries so we can assert that we have absolute paths everywhere. I agree it's just extremely unclear how you are supposed to deal with relative paths of any kind. There's also the issue that some of the tools we call like |
Since we spawn a new process for |
What's done
runSession*
family function, properly addTestConfig
,runSessionWithTestConfig
, as the most genericrunSession*
function.runSession*
functions and replaced byrunSessionWithTestConfig
.ExceptionTests ClientSettingsTests CodeLensTests CPPTests CradleTests
to use thehls-test-utils
getCurrentDirectory
(After DefaultMain is called), Only remain those in top level of wrapper and exe, implement Overhauling the HLS testsuite #3736 (comment)What's remains:
TestConfig
, maybe we can refactor them to useTestConfig
and cut the number of variants too.hie.yaml
specify relative files