Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Format won't work after using % s/old/new/g in neovim #171

Description

@scottming

This is the error

lexical: -32803: %SyntaxError{file: "/Users/scottming/Code/dummy/lib/dummy.ex", line: 9, column: 16, snippet: %{content: "    |>
 Enum.ff(&String.contains?(&1, \"a\"))", offset: 15}, description: "unexpected token: Codepoint failed identifier tokenizatio
n, but a simpler form was found.\n\nGot:\n\n    \"ffï¢\" (code points 0x00066 0x00066 0x000EF 0x000A2)\n\nHint: You could write
the above in a similar way that is accepted by Elixir:\n\n    \"ffïc̸\" (code points 0x00066 0x00066 0x000EF 0x00063 0x00338)\n\n
See https://hexdocs.pm/elixir/unicode-syntax.html for more information."}
defmodule Dummy do
  @moduledoc false

  def hello do
    :world

    ["a", "b", "c"]
    |> Enum.filter(&String.contains?(&1, "x"))
    |> Enum.filter(&String.contains?(&1, "a"))
  end
end

and then % s/filter/f/g, then do format.

I'm not sure if this is a lexical bug or not, will add more information later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions