-
Notifications
You must be signed in to change notification settings - Fork 0
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
Write hls unit tests for get references #1
Write hls unit tests for get references #1
Conversation
save source file location to db Find source for boot files Use DynFlags from HieDb instead of unsafeGlobalDynFlags Return multiple definitions don't typecheck files on load Add support for persistent stale values Add persistent hie file rule docs wip better typedef defs for deps update hiedb Fix for files with errors Fix build integrate hiedb commands and set dynflags on boot workspace symbol tweaks, cabal.project Write ifaces on save use real mtime for saved files safe indexing bump hiedb Proper refs for FOIs hlint Update exe/Main.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Review comments update hiedb Update src/Development/IDE/Core/Shake.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Core/Rules.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Core/Rules.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Spans/AtPoint.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Core/Rules.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Apply suggestions from code review Co-authored-by: Pepe Iborra <pepeiborra@me.com> more careful re-indexing update for hiedb-0.1.0.0 Remove cached-deps stuff for now explicit showSDoc docs in AtPoint add doc comment about database consistency add TODO for better position mapping from diff
Hacks to tactics plugic, class plugin, cabal file, and main.
This block of code that uses nub used to be part of main. But it got split off into a new function called runIde, and the hlint annotation was not updated to match.
We have this code: 20: ddd :: Num a => a -> a -> a 21: ddd vv ww = vv +! ww The intention was to ask for the type definition of symbol "a" in line 20, and then assert that no type definitions were found. The reality is that the test was asking for the definition of the symbol at (20, 15) in 0-based indexing, which is the "!" in "+!". Until recently, ghcide could not find type definitions for "+!", so no type definitions were found and the test passed. But now, ghcide can find type definitions for "+!", and this test has begun to fail. The solution is to change (20, 15) to (19, 15), so that we ask for the type definitions of the symbol "a", which will not be found.
a7d52c5
to
604b746
Compare
Very nice, this looks quite helpful. I think we will need a few test messages to indicate that indexing has completed and synchronize to avoid race condition style failures in tests(i.e. we ask for references too early and get an incomplete result), so this is what I have been working on. This might be the cause of some of the failures you are seeing. Sorry for the late response, github didn't notify me for either this PR or the comment on the draft HLS PR for some reason. It's very late tonight, so I will take a proper look tomorrow. |
I figured you were busy, it's not a problem. :) Dunno why it didn't notify you. The nix builds are failing with something dependency related:
And the pre 8.10 builds are failing like this:
So it's not race condition related, the build is simply broken. Note the review comment below though. |
_ <- openDoc "dependencyfoo/src/ModuleInDependency.hs" "haskell" | ||
_ <- openDoc "dependencyfoo/src/OtherModuleInDependency.hs" "haskell" | ||
liftIO $ sleep 2 | ||
f |
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 is a kludge to make sure references are ready before we ask for them.
Getting a type definition can produce more than one result. E.g. the type of the symbol "pid" in: 1: data Parameter a = Parameter a 2: f :: forall a. Parameter a -> Parameter a 3: f pid = pid is (Parameter a), and the definition of this type is two part: the definition of Parameter on line 1, and the definition of a on line 2.
8.8.3
vs 8.10.2
|
FunTy takes a third argument in 8.10.1 and on.
2654bae
to
5e5d637
Compare
haskell#704