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

feat: support retract as keyword in go.mod #3162

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 8 additions & 5 deletions syntax/gomod.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ syntax keyword gomodGo go contained
syntax keyword gomodRequire require
syntax keyword gomodExclude exclude
syntax keyword gomodReplace replace
syntax keyword gomodRetract retract

" require, exclude, replace, and go can be also grouped into block
syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion
syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion
syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion
syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion
" require, exclude, replace, retract, and go can be also grouped into block
syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion
syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion
syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion
syntax region gomodRetract start='retract \[' end='\]' transparent contains=gomodRetract,gomodVersion
syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion

" set highlights
highlight default link gomodModule Keyword
highlight default link gomodGo Keyword
highlight default link gomodRequire Keyword
highlight default link gomodExclude Keyword
highlight default link gomodReplace Keyword
highlight default link gomodRetract Keyword

" comments are always in form of // ...
syntax region gomodComment start="//" end="$" contains=@Spell
Expand Down