-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[REPL] Autocompletion of ModuleName.@macro_name
is broken
#55518
Comments
I just ran again into this by trying to autocomplete in the REPL a |
We have an upgrade: also autocompletion of keyword arguments is now broken:
Trying to autocomplete the value of the keyword arguments complete only symbols within the module, also those that aren't exported and so you shouldn't even be able to reference them unless you imported them explicitly, which I didn't here. |
doesn't complete the symbol after the semicolon, same for macros:
Basically after you type the module name you're damned to complete things within the module in the entire line, including after a semicolon to separate expressions. |
@aviatesk any idea on this one? I think Mose's last summary above is key, I just can't figure out where the restriction to the module is happening. |
It looks like the julia/stdlib/REPL/src/REPLCompletions.jl Line 1219 in 5b677a1
, which causes the method to use the prefix as the module context: julia/stdlib/REPL/src/REPLCompletions.jl Lines 161 to 177 in 5b677a1
So I think we need to fix the |
I assume this is related to #54858 ? I see that's not on 1.11 and |
Other related breakage:
completes to |
We may want to revert the PR that introduced module specific completion. I think the experience may be worse than before that. |
This commit replaces the heuristic parsing done by REPLCompletions.completions with a new approach that parses the entire input buffer once with JuliaSyntax. In addition to fixing bugs, the more precise parsing should allow for new features in the future. Some features now work in more situations "for free", like dictionary key completion (the expression evaluated to find the keys is now more precise) and method suggestions (arguments beyond the cursor can be used to narrow the list). The tests have been updated to reflect slightly differing behaviour for string and Cmd-string completion: the new code returns a character range encompassing the entire string when completing paths (not observable by the user), and the behaviour of '~'-expansion has be tweaked to be consistent across all places where paths can be completed. Some escaping issues have also been fixed. Fixes: JuliaLang#55420, JuliaLang#55518, JuliaLang#55520, JuliaLang#55842, JuliaLang#56389, JuliaLang#57611
This commit replaces the heuristic parsing done by REPLCompletions.completions with a new approach that parses the entire input buffer once with JuliaSyntax. In addition to fixing bugs, the more precise parsing should allow for new features in the future. Some features now work in more situations "for free", like dictionary key completion (the expression evaluated to find the keys is now more precise) and method suggestions (arguments beyond the cursor can be used to narrow the list). The tests have been updated to reflect slightly differing behaviour for string and Cmd-string completion: the new code returns a character range encompassing the entire string when completing paths (not observable by the user), and the behaviour of '~'-expansion has be tweaked to be consistent across all places where paths can be completed. Some escaping issues have also been fixed. Fixes: JuliaLang#55420, JuliaLang#55518, JuliaLang#55520, JuliaLang#55842, JuliaLang#56389, JuliaLang#57611
This commit replaces the heuristic parsing done by REPLCompletions.completions with a new approach that parses the entire input buffer once with JuliaSyntax. In addition to fixing bugs, the more precise parsing should allow for new features in the future. Some features now work in more situations "for free", like dictionary key completion (the expression evaluated to find the keys is now more precise) and method suggestions (arguments beyond the cursor can be used to narrow the list). The tests have been updated to reflect slightly differing behaviour for string and Cmd-string completion: the new code returns a character range encompassing the entire string when completing paths (not observable by the user), and the behaviour of '~'-expansion has be tweaked to be consistent across all places where paths can be completed. Some escaping issues have also been fixed. Fixes: JuliaLang#55420, JuliaLang#55518, JuliaLang#55520, JuliaLang#55842, JuliaLang#56389, JuliaLang#57611
On 5230d27
autocompletes
nothi
tonothing_sentinel
:If I understand it correctly,
ModuleName.@macro symbol<TAB>
autocompletessymbol
insideModuleName
, notMain
:This works correctly in Julia v1.10 and v1.11.0-rc1
The text was updated successfully, but these errors were encountered: