Open Frid-Yuandu opened 1 week ago
Thanks for the report, I'll take a look. Lexical shouldn't crash here.
If i was reviewing that code, I would offer that the pipeline is unnecessary in that case and just adds noise. The first code you have there seems more idiomatic to me.
If i was reviewing that code, I would offer that the pipeline is unnecessary in that case and just adds noise. The first code you have there seems more idiomatic to me.
You are right, it is a edge case and not so idiomatic.
I make more test, i presume this error occurs when piping a collection type literal (I'm not sure if this is accurate) to a function in a formatting string?
require Record
Record.defrecord(:foo, hello: "world")
# these will triggered error
"test: #{{"localhost", 443} |> inspect_peername()}"
"test: #{["localhost", 443] |> inspect_peername()}"
"test: #{%{} |> inspect_peername()}"
# these below won triggered error
"test: #{foo() |> inspect()}"
"test: #{"localhost" |> inspect_peername()}"
"test: #{65535 |> inspect()}"
"test: #{connect_to_server() |> elem(1) |> inspect()}"
"test: #{:localhost |> inspect()}"
I got a
Request textDocument/completion failed.
error. Here is the log:I referenced previous issues related to this error, but it didn't help much. So I went back and checked the source code pointed out in the log.
I tried changing the code to the following form and the error magically disappeared. So I tried a few different ways of writing it and found that none of these below triggered the error: