Skip to content

Conversation

@Keno
Copy link
Member

@Keno Keno commented Apr 27, 2023

The new completion for var" fields (#49294) failed when the var" was at the end of the completion query, e.g. in WeirdNames().var". This is because we have the following behavior:

julia> findprev(==('x'), "x", 1)
1

julia> findprev(==('x'), "x", 2)

REPLCompletions attempt to find . starting after the var", which in this case is at the end of the string. Of course, the index was probably off by one anyway, because
we didn't want to match var"., but nevertheless, I find this behavior surprising (ref also [1]).
For now, fix this by starting the search before the var", but we may want to revisit the findprev behavior also.

[1] https://github.com/JuliaLang/julia/pull/35742/files#r420945975

The new completion for `var"` fields (#49294) failed
when the `var"` was at the end of the completion query,
e.g. in `WeirdNames().var"`. This is because we have the
following behavior:

```
julia> findprev(==('x'), "x", 1)
1

julia> findprev(==('x'), "x", 2)
```

REPLCompletions attempt to find `.` starting after the `var"`,
which in this case is at the end of the string. Of course,
the index was probably off by one anyway, because
we didn't want to match `var".`, but nevertheless,
I find this behavior surprising (ref also [1]).
For now, fix this by starting the search before the `var"`,
but we may want to revisit the `findprev` behavior also.

[1] https://github.com/JuliaLang/julia/pull/35742/files#r420945975
@giordano giordano added REPL Julia's REPL (Read Eval Print Loop) bugfix This change fixes an existing bug labels Apr 27, 2023
@Keno Keno merged commit 645f7af into master Apr 28, 2023
@Keno Keno deleted the kf/fix49294 branch April 28, 2023 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug REPL Julia's REPL (Read Eval Print Loop)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants