Autocomplete hinders definition of userfunctions
Enter the following expression: f(x)=5*x
Press ENTER
.
The expression will autocomplete to f(x)=5*xor()
.
The autocomplete should also take care of the arguments of a user function.
Comments (9)
-
repo owner -
reporter Can you expand on which other features provoke this behaviour? I was only aware of user function arguments.
(Also note that my PR includes a solution to this; I only posted this issue now that I wrote a complete write-up of what we did in the PR.)
-
repo owner I meant that if you simpy write "5 * x<ENTER>" it will have the same behavior, not specific to user functions. Unless I misunderstood what your point. Are you referring to pull request #18 ?
-
reporter Your example is not really an issue. If the variable
x
is not defined, then summoning the autocompleter will indeed spit outxor
. Ifx
is properly defined though, it will suggest that one instead.Yes, I am referring to PR #18. I put a note about it on the bottom on the description.
-
If
x
is defined as a user variable or a user function, typing5 * x<ENTER>
will have the correct behavior (x
not being replaced if it's a user variable, or else,x
being replaced by the user function). Otherwise, the auto-completion will replacex
byxor()
which is also the expected behavior asx
does not exist anyway.I believe the only use case when this is not the correct behavior is the one given by Pol, when defining a user function and
x
is one of the argument of that function. Pol fixed it at this line so that the autocompletion algorithm is aware of the user function argument names when defining a user function. I can't check it work yet but the code looks correct. -
repo owner Oh, I totally misunderstood it. I see what you mean now. Thanks, guys.
-
repo owner - changed milestone to 0.12
-
reporter - changed status to resolved
Fixed in #dec6328
-
repo owner - changed status to closed
- Log in to comment
Not specific to user functions. I know about this annoyance, but I'm also not sure what the best behavior would be. Open for feedback ( @Teyut @fk @thadrien ). I'm not sure, but there may be a separate issue for the user function argument completion already.