Skip to content
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

Regression in autocomplete for Julia 1.10 #57307

Open
nilshg opened this issue Feb 7, 2025 · 4 comments · May be fixed by #57767
Open

Regression in autocomplete for Julia 1.10 #57307

nilshg opened this issue Feb 7, 2025 · 4 comments · May be fixed by #57767
Labels
bug Indicates an unexpected problem or unintended behavior completions Tab and autocompletion in the repl

Comments

@nilshg
Copy link
Contributor

nilshg commented Feb 7, 2025

I feel like I discussed this with people before but there isn't an issue:

~> julia +1.9 -q 

julia> nt = (col1 = 5, secondcol = 6)
(col1 = 5, secondcol = 6)

julia> nt.col1 = nt.sec<TAB> # autocompletes

julia> exit()

~> julia +1.10 -q

julia> nt = (col1 = 5, secondcol = 6)
(col1 = 5, secondcol = 6)

julia> nt.col1 = nt.sec<TAB> # crickets

Still broken on 1.11.3, so I assume this is a JuliaSyntax thing?

@fingolfin
Copy link
Member

I can confirm this is also broken on master. Note that the REPL completion code also underwent a major refactoring, and IIRC (but I might not) this was between 1.9 and 1.10. So that could also be responsible. Perhaps @aviatesk or @IanButterworth know better?

@IanButterworth
Copy link
Member

There are unfortunately a variety of completions regressions: https://github.com/JuliaLang/julia/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20label%3Acompletions%20label%3Abug

I've looked into trying to fix them, but not been able to make progress. The regressions seem mostly caused by the improvements @aviatesk made because we didn't/don't have as much test coverage as we should have for completion behavior.

@IanButterworth IanButterworth added bug Indicates an unexpected problem or unintended behavior completions Tab and autocompletion in the repl labels Feb 7, 2025
@aviatesk
Copy link
Member

aviatesk commented Feb 7, 2025

Agh, this isn't good. I didn't expect so many regressions. I think we have a few options:

  1. Revert the original commit: But my changes were made over a year (or years?) ago, so reverting now might be tough.
  2. Patch each issue individually: It's tedious, but that's probably this is exactly how we've improved REPL completion quality so far.
  3. Use something like JuliaSyntax to more intelligently parse and detect the code we're trying to complete.

Option 1 probably isn't realistic, so we're likely stuck with 2 or 3.
Personally, I'd prefer to go with option 3. I'm actually working on a new completion engine for another project, so in the near future, I might be able to apply what I learn there to option 3.
But I'm currently swamped with that project and don't have the bandwidth to dedicate time to individual issues in JuliaLang/julia right now.
So, if anyone else has time to work on option 2 or 3, that would be a huge help.

@nilshg
Copy link
Contributor Author

nilshg commented Feb 10, 2025

I'll just add that someone on Slack had a theory that autocomplete is now "smart" and won't autocomplete the nt.sec in my example because NamedTuples are immutable and so I can't assign to nt.col1 anyway. They correctly pointed out that

nt.col1 == nt.sec

does autocomplete. I'm not sure whether that's true, but I'll note that

julia> nt = (; col1 = rand(2), secondcol = rand(2));

julia> nt.col1 .= nt.sec

also doesn't autocomplete, despite nt.col1 being mutable.

Finally, my issue was mainly motivated by DataFrames type workflows like

julia> df = DataFrame(col1 = rand(2), secondcol = rand(2));

julia> df.col1 = df.seco

which are also broken.

@xal-0 xal-0 linked a pull request Mar 13, 2025 that will close this issue
@giordano giordano linked a pull request Mar 14, 2025 that will close this issue
@giordano giordano removed a link to a pull request Mar 14, 2025
@giordano giordano linked a pull request Mar 14, 2025 that will close this issue
xal-0 added a commit to xal-0/julia that referenced this issue Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior completions Tab and autocompletion in the repl
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants