shorter_maps icon indicating copy to clipboard operation
shorter_maps copied to clipboard

"invalid assumptions on how elixir AST looks like"

Open thomasdziedzic-calmwave opened this issue 2 years ago • 2 comments

Background: https://github.com/elixir-lsp/elixir-ls/issues/928#issuecomment-1614643525

I opened a bug with elixirls because I was getting a warning from vscode:

(ArgumentError) interpolation is not supported with the ~M sigil

Stacktrace:
  │ (shorter_maps 2.2.5) expanding macro: ShorterMaps.sigil_M/2

When using ~M in function heads even though the code compiled correctly.

It seems like one of the maintainers of ElixirLS thinks this is because:

https://github.com/meyercm/shorter_maps/blob/04b1f4b51a4d7d1cca0707e4ec86ab0cb8a454fd/lib/shorter_maps.ex#L31 ElixirLS changes decault compiler options to get column metadata on errors. This library assumes there is no :column in metaadata.

thomasdziedzic-calmwave avatar Jun 30 '23 13:06 thomasdziedzic-calmwave

found a fix for this at https://github.com/boyzwj/shorter_maps/commit/787c3447e48c74cf3224f35aba03c84f4c6a3c13 so for now it isn't annoying me anymore, but it would be nice to have a fix for this issue in the official repo.

thomasdziedzic-calmwave avatar Jul 06 '23 17:07 thomasdziedzic-calmwave

#18 should also fix this issue, from what can tell.

astutecat avatar Feb 07 '24 11:02 astutecat