Skip to content
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
5 changes: 2 additions & 3 deletions syntax/prisma.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
syn case match

" Comment
syn match prismaComment "\v//.*$"
syn match prismaComment "\v\s*//.*$"
" Directive
syn match prismaDirective /\<@@\=\h\w*/ nextgroup=prismaFunctionParans
" Ugly hack right now, probably this is not needed after refactoring
Expand All @@ -24,7 +24,7 @@ syn match prismaType /\<\h\w*\>/ contained containedin=prismaModelDeclaration ne
syn region prismaFieldRegion start=/\v^\s*/ms=e+1 end=/\v\s/me=s-1 contains=prismaField,prismaComment contained transparent containedin=prismaModelDeclaration skipwhite
syn match prismaMultiFieldDirective /^\s*@/ contained containedin=prismaModelDeclaration nextgroup=prismaPartialDirective

syn region prismaNonModelDeclaration matchgroup=prismaModel start=/\v((datasource)=(generator)=(enum)=)+\s+\h\w*\s*\{/ end=/}/ contains=prismaString,prismaList,prismaValueDeclarationRegion,prismaOperator transparent
syn region prismaNonModelDeclaration matchgroup=prismaModel start=/\v((datasource)=(generator)=(enum)=)+\s+\h\w*\s*\{/ end=/}/ contains=prismaString,prismaList,prismaValueDeclarationRegion,prismaOperator,prismaComment transparent
syn match prismaValue /\<\h\w*\>/ contained containedin=prismaValueDeclarationRegion,prismaTypeAliasDeclaration nextgroup=prismaOperator skipwhite
syn region prismaValueDeclarationRegion start=/\v^\s*/ms=e+1 end=/\v\s*/me=s-1 contains=prismaValueDeclaration contained transparent containedin=prismaNonModelDeclaration skipwhite

Expand All @@ -33,7 +33,6 @@ syn match prismaOperator "\[\]" display
syn match prismaOperator /\v\=/ display
syn region prismaList matchgroup=prismaList start="\[" end="]" contains=ALLBUT,prismaDirective,prismaModelDeclaration,prismaNonModelDeclaration


hi def link prismaList Delimiter
hi def link prismaParans Delimiter
hi def link prismaDirective PreProc
Expand Down