Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Nx common macros syntax highlight #568

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions syntax/elixir.vim
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,26 @@ syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\(\s\|(\)\+\)\@<=\~[Ss]\z("""\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend

" Defines
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
syn match elixirNumericalDefine '\<defn\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirGuard '\<defguard\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirPrivateGuard '\<defguardp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
syn match elixirProtocolDefine '\<defprotocol\>\(:\)\@!' nextgroup=elixirProtocolDeclaration skipwhite skipnl
syn match elixirImplDefine '\<defimpl\>\(:\)\@!' nextgroup=elixirImplDeclaration skipwhite skipnl
syn match elixirRecordDefine '\<defrecord\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
syn match elixirPrivateRecordDefine '\<defrecordp\>\(:\)\@!' nextgroup=elixirPrivateRecordDeclaration skipwhite skipnl
syn match elixirMacroDefine '\<defmacro\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
syn match elixirPrivateMacroDefine '\<defmacrop\>\(:\)\@!' nextgroup=elixirPrivateMacroDeclaration skipwhite skipnl
syn match elixirDelegateDefine '\<defdelegate\>\(:\)\@!' nextgroup=elixirDelegateDeclaration skipwhite skipnl
syn match elixirOverridableDefine '\<defoverridable\>\(:\)\@!' nextgroup=elixirOverridableDeclaration skipwhite skipnl
syn match elixirExceptionDefine '\<defexception\>\(:\)\@!' nextgroup=elixirExceptionDeclaration skipwhite skipnl
syn match elixirCallbackDefine '\<defcallback\>\(:\)\@!' nextgroup=elixirCallbackDeclaration skipwhite skipnl
syn match elixirStructDefine '\<defstruct\>\(:\)\@!' skipwhite skipnl
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
syn match elixirNumericalDefine '\<defn\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirPrivateNumericalDefine '\<defnp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
syn match elixirTransform '\<deftransform\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirPrivateTransform '\<deftransformp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
syn match elixirGuard '\<defguard\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn match elixirPrivateGuard '\<defguardp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
syn match elixirProtocolDefine '\<defprotocol\>\(:\)\@!' nextgroup=elixirProtocolDeclaration skipwhite skipnl
syn match elixirImplDefine '\<defimpl\>\(:\)\@!' nextgroup=elixirImplDeclaration skipwhite skipnl
syn match elixirRecordDefine '\<defrecord\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
syn match elixirPrivateRecordDefine '\<defrecordp\>\(:\)\@!' nextgroup=elixirPrivateRecordDeclaration skipwhite skipnl
syn match elixirMacroDefine '\<defmacro\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
syn match elixirPrivateMacroDefine '\<defmacrop\>\(:\)\@!' nextgroup=elixirPrivateMacroDeclaration skipwhite skipnl
syn match elixirDelegateDefine '\<defdelegate\>\(:\)\@!' nextgroup=elixirDelegateDeclaration skipwhite skipnl
syn match elixirOverridableDefine '\<defoverridable\>\(:\)\@!' nextgroup=elixirOverridableDeclaration skipwhite skipnl
syn match elixirExceptionDefine '\<defexception\>\(:\)\@!' nextgroup=elixirExceptionDeclaration skipwhite skipnl
syn match elixirCallbackDefine '\<defcallback\>\(:\)\@!' nextgroup=elixirCallbackDeclaration skipwhite skipnl
syn match elixirStructDefine '\<defstruct\>\(:\)\@!' skipwhite skipnl

" Declarations
syn match elixirModuleDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirBlock skipwhite skipnl
Expand Down Expand Up @@ -189,6 +192,9 @@ hi def link elixirBlockDefinition Define
hi def link elixirDefine Define
hi def link elixirPrivateDefine Define
hi def link elixirNumericalDefine Define
hi def link elixirPrivateNumericalDefine Define
hi def link elixirTransform Define
hi def link elixirPrivateTransform Define
hi def link elixirGuard Define
hi def link elixirPrivateGuard Define
hi def link elixirModuleDefine Define
Expand Down