-
Notifications
You must be signed in to change notification settings - Fork 92
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
Rewrite progress handling to allow for debouncing messages #571
Conversation
@soulomoon what do you think? I think the |
I also need to actually test this with a live HLS and see if I can actually notice the difference! |
c228abb
to
afedfb1
Compare
This had to be redone in order to allow us to "wake up" and notice that there are pending messages. I also wrote it so there can be a stateful interface (the `ProgressTracker`) which I think might make it easier to use in that weird case in `ghcide`. I haven't exposed that yet, though.
afedfb1
to
b81f25c
Compare
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.
Sounds good, it seems it is exactly the kind of flexibility HLS reports need.
But I am not sure about the global delay.
@@ -138,6 +140,10 @@ data LanguageContextEnv config = LanguageContextEnv | |||
resState :: !(LanguageContextState config) | |||
, resClientCapabilities :: !L.ClientCapabilities | |||
, resRootPath :: !(Maybe FilePath) | |||
, resProgressStartDelay :: Int |
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.
Maybe this can be set for each progress instead of globally? Since we might want different delay for different progress
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 can't actually think of a use case for this. I think it should be pretty generic?
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 inclined to leave it as global for now unless we have a need for it to be different.
This piece of code in HLS is quite delicate, the previous version did not work well. |
0a6728c
to
e65065a
Compare
e65065a
to
1b9cc1d
Compare
Turns out the stateful interface wasn't really that helpful and complicated things, I think haskell/haskell-language-server#4218 is actually perfectly fine with the normal interface, arguably even clearer. |
b05ee42
to
e4ab8c5
Compare
4f63f44
to
f45f29c
Compare
This had to be redone in order to allow us to "wake up" and notice that there are pending messages. I also wrote it so there can be a stateful interface (the
ProgressTracker
) which I think might make it easier to use in that weird case inghcide
. I haven't exposed that yet, though.