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
I would expect the surround_context for a sigil to span the entire body of the sigil. My use case is that I'd like to be able to determine when I'm in a ~H sigil in elixir-ls. Should surround_context return information about the "container" that I am in (this was my take from the docs), or am I mistaking this for another API?
The text was updated successfully, but these errors were encountered:
I don't think there is an API to return this today, one would need to be added. The reason why surround_context is not a good candidate for this are two:
Sometimes you want the surround context inside a sigil itself, think autocompletion inside HEEx
surround_context only looks at the current line, so it wouldn't work for a multiline sigil
The best candidate would be to change Code.Fragment.container_cursor_to_quoted("~D[2025-01-01") to return we are inside a sigil if an option is given. We could probably do it somewhat cleanly by returning something like sigil_D(<<"2025-01-01", __cursor__>>.
Elixir and Erlang/OTP versions
❯ elixir --version
Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)
Operating system
Arch Linux x86_64 6.12.1-arch1-1
Current behavior
Expected behavior
I would expect the
surround_context
for a sigil to span the entire body of the sigil. My use case is that I'd like to be able to determine when I'm in a~H
sigil inelixir-ls
. Shouldsurround_context
return information about the "container" that I am in (this was my take from the docs), or am I mistaking this for another API?The text was updated successfully, but these errors were encountered: