Skip to content

Commit

Permalink
Rename module highlight token
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Dec 15, 2021
1 parent de3ec57 commit 84a627e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
(float)
] @number

(alias) @type
(alias) @module

(call
target: (dot
left: (atom) @type))
left: (atom) @module))

(char) @constant

Expand Down
4 changes: 2 additions & 2 deletions test/highlight/anonymous.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ end

&Set.put(&1, &2)
# <- operator
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand All @@ -55,7 +55,7 @@ end
&( Set.put(&1, &1) )
#<- operator
#^ punctuation.bracket
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand Down
12 changes: 6 additions & 6 deletions test/highlight/calls.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Path.expand("..", __DIR__)
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand Down Expand Up @@ -35,7 +35,7 @@ hd([1,2])
# ^ punctuation.bracket

Kernel.spawn(fn -> :ok end)
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand All @@ -46,20 +46,20 @@ Kernel.spawn(fn -> :ok end)
# ^ punctuation.bracket

IO.ANSI.black
# ^ type
# ^ module
# ^ operator
# ^ function

Kernel.-(number)
# ^ type
# ^ module
# ^ operator
# ^ operator
# ^ punctuation.bracket
# ^ variable
# ^ punctuation.bracket

Enum.map([1, 2], fn x ->
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand All @@ -81,7 +81,7 @@ end)
# ^ punctuation.bracket

:erlang.abs(-1)
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand Down
8 changes: 4 additions & 4 deletions test/highlight/data_structures.ex
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,16 @@

%Long.Module.Name{name: "Silly"}
# <- punctuation
# ^ type
# ^ type
# ^ module
# ^ module
# ^ punctuation.bracket
# ^ string.special.symbol
# ^ string
# ^ punctuation.bracket

%Long.Module.Name{s | height: {192, :cm}}
# <- punctuation
# ^ type
# ^ module
# ^ punctuation.bracket
# ^ variable
# ^ operator
Expand All @@ -185,7 +185,7 @@
# ^ string
# ^ punctuation.special
# ^ punctuation
# ^ type
# ^ module
# ^ punctuation.bracket
# ^ variable
# ^ operator
Expand Down
2 changes: 1 addition & 1 deletion test/highlight/identifiers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _018OP
# ^ comment.unused

A__0
# ^ type
# ^ module

__MODULE__ ; __STACKTRACE__
# ^ constant.builtin
Expand Down
10 changes: 5 additions & 5 deletions test/highlight/kernel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ end

raise RuntimeError, message: "This is not an error"
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ string

import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2]
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ punctuation.bracket
Expand All @@ -165,11 +165,11 @@ import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2]

alias Long.Module.Name, as: N0men123_and4
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ type
# ^ module

use Bitwise
# ^ keyword
# ^ type
# ^ module
14 changes: 7 additions & 7 deletions test/highlight/module.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Long.Module.Name do
# ^ keyword
# ^ type
# ^ type
# ^ module
# ^ module
# ^ keyword

@moduledoc "Simple doc"
Expand Down Expand Up @@ -80,7 +80,7 @@ defmodule Long.Module.Name do
# ^ attribute
# ^ variable
# ^ operator
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ punctuation.bracket
Expand Down Expand Up @@ -256,7 +256,7 @@ defmodule Long.Module.Name do
# ^ punctuation.bracket
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ type
# ^ module

defmacro meta_function(name) do
# ^ keyword
Expand Down Expand Up @@ -297,7 +297,7 @@ end

defprotocol Useless do
# ^ keyword
# ^ type
# ^ module
# ^ keyword
def func(this)
# ^ keyword
Expand All @@ -310,10 +310,10 @@ end

defimpl Useless, for: Atom do
# ^ keyword
# ^ type
# ^ module
# ^ punctuation.delimiter
# ^ string.special.symbol
# ^ type
# ^ module
# ^ keyword
end
# <- keyword
4 changes: 2 additions & 2 deletions test/highlight/operators.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ y = true and false
"hello" |> String.upcase |> String.downcase()
# ^ string
# ^ operator
# ^ type
# ^ module
# ^ operator
# ^ function
# ^ operator
# ^ type
# ^ module
# ^ operator
# ^ function

0 comments on commit 84a627e

Please sign in to comment.