You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summarizing the approach discussed with @josevalim (sorry, rough notes):
Will got with 2. (Provide some a new API that does not drop valid code after cursor), with an API taking an extra cursor position.
Steps:
container_cursor_to_quoted/3 which splits the input at line+column
call the tokenizer with the rest of the input with check_terminators: false, and match do/end+fn/end pairs until there is a -> or an dangling end
optimize step 2
change the tokenizer to return a "prefix" in case cursor_completion: true and we stop in the middle of a string/sigil/heredoc, and append the prefix when doing step 2/3
Elixir and Erlang/OTP versions
Erlang/OTP 26 [erts-14.2.5.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.17.2 (compiled with Erlang/OTP 26)
Operating system
any
Current behavior
In cases where relevant information is after the operator the returned AST is suboptimal. An example (with cursor marked as
|
)AST returned
as if the code was
This means the cursor is on the wrong case branch and in wrong context.
I understand that the behaviour is a consequence of tokenizer dropping all code after the cursor and in this case the result is ambiguous.
Expected behavior
Some ideas.
The text was updated successfully, but these errors were encountered: