elixir-editors / vim-elixir

Vim configuration files for Elixir
http://elixir-lang.org/
Other
1.31k stars 153 forks source link

Wrong syntax highlight #418

Closed NJichev closed 5 years ago

NJichev commented 6 years ago

Got following type not syntax highlighted as an atom:

@type t :: %TestSuite{test: (() -> any), status: :pending}

The test: key is different from status(from ExUnit I suppose)

mhinz commented 6 years ago

Hmm, there is no difference for me.

Both, test: and status: are highlighted as elixirAtom, if I put that single line in an .ex file.

What does :echo synIDattr(synID(line("."), col("."), 1), "name") report if the cursor is over the key?

NJichev commented 6 years ago

It says elixirExUnitMacro.

Here's the extracted piece of code:

defmodule TestSuite.Test do
  @typep f :: (() -> any)
  @typep status :: :pending | :failed | :skipped | :timed_out | :passed
  @typep tags :: [atom]

  @type t :: %Test{
    test: f,
    status: status,
    tags: tags,
  }
end

Could be a PEBKAC problem :D

mhinz commented 6 years ago

Well, I can reproduce it with that code. I'll look into it.