-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Tab expansion of NamedTuple fails on 1.10.0-beta2 #51194
Labels
bisect wanted
regression
Regression in behavior compared to a previous version
REPL
Julia's REPL (Read Eval Print Loop)
Comments
Interestingly for regular structs (e.g. complex numbers) this still works. |
Pretty sure the bisect will find #49206 but would be good to be sure. |
JeffBezanson
added
the
regression
Regression in behavior compared to a previous version
label
Sep 6, 2023
KristofferC
pushed a commit
that referenced
this issue
Oct 12, 2023
Fix #51194 This PR fixes a regression introduced in #49294, so I believe it should be backported to v1.10. In the current code, completion of `qux(foo, bar.` is detected by parsing `foo(qux, bar` as an incomplete expression, and then looking for the sub-expression to complete (here, `bar.`). This approach fails however for infix calls, since completing `foo + bar.` starts by parsing `foo + bar`, which is a complete call expression, and so the code behaves as if completing `(foo + bar).` instead of `bar.`. This leads to the current problematic behaviour: ```julia julia> Complex(1, 3) + (4//5).#TAB im re ``` which would be correct for `(Complex(1, 3) + (4//5)).#TAB`, but here we expect ```julia julia> Complex(1, 3) + (4//5).#TAB den num ``` This PR fixes that by trying to detect infix calls. In the long term, all this ad-hoc and probably somewhat wrong string processing should be replaced by proper use of `JuliaSyntax` (as mentioned in #49294 (comment), #50817 (comment) and probably other places), but for now at least this fixes the regression.
KristofferC
pushed a commit
that referenced
this issue
Oct 12, 2023
Fix #51194 This PR fixes a regression introduced in #49294, so I believe it should be backported to v1.10. In the current code, completion of `qux(foo, bar.` is detected by parsing `foo(qux, bar` as an incomplete expression, and then looking for the sub-expression to complete (here, `bar.`). This approach fails however for infix calls, since completing `foo + bar.` starts by parsing `foo + bar`, which is a complete call expression, and so the code behaves as if completing `(foo + bar).` instead of `bar.`. This leads to the current problematic behaviour: ```julia julia> Complex(1, 3) + (4//5).#TAB im re ``` which would be correct for `(Complex(1, 3) + (4//5)).#TAB`, but here we expect ```julia julia> Complex(1, 3) + (4//5).#TAB den num ``` This PR fixes that by trying to detect infix calls. In the long term, all this ad-hoc and probably somewhat wrong string processing should be replaced by proper use of `JuliaSyntax` (as mentioned in #49294 (comment), #50817 (comment) and probably other places), but for now at least this fixes the regression. (cherry picked from commit e949236)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bisect wanted
regression
Regression in behavior compared to a previous version
REPL
Julia's REPL (Read Eval Print Loop)
This worked on 1.9, does not on 1.10.0-beta2.
A = (; foo=2, bar=3)
, and then typeA.foo + A.b<TAB>
.bar
does not get expanded.The text was updated successfully, but these errors were encountered: