REPL: generate tab completion hints on a worker thread to not block typing #57192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prevents slow tab completion hint generation from blocking typing.
Fixes #55434
Specifically the hinting part.
With julia now starting with an interactive thread by default, we can move the repl tab completion hint generation to a worker thread and enable the user to continue to type (on the repl task on the interactive thread) if generating the hint takes a long time. Showing old hints is cancelled if a new key has been pressed since.
Take this intentionally slowly compiling generated function, which needs to be generated to be introspected for completions. (thanks @MasonProtter for the example)
On master and 1.11 typing is blocked at
foo().
while the generated function compiles for 5s.On this PR typing can continue and at any point the user can wait 5s for
apple
to be completed properly.Screen.Recording.2025-01-28.at.10.30.27.PM.mov