Skip to content

Commit

Permalink
feat: add syntax highlighting for arbitrary module identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Sep 11, 2024
1 parent b325c44 commit 404af73
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions syntax/ts-common/keyword.vim
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
"Import
syntax keyword typescriptImport from as
syntax keyword typescriptImport import
\ nextgroup=typescriptImportType,typescriptTypeBlock,typescriptDefaultImportName
\ nextgroup=typescriptImportType,typescriptImportBlock,typescriptDefaultImportName
\ skipwhite
syntax keyword typescriptImportType type
\ contained
syntax match typescriptDefaultImportName /\v\h\k*( |,)/
\ contained
\ nextgroup=typescriptImportBlock
\ skipwhite skipempty
syntax region typescriptImportBlock
\ matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contained
\ contains=typescriptIdentifierName,typescriptImportType,typescriptString
\ fold
syntax keyword typescriptExport export
\ nextgroup=typescriptExportType
\ skipwhite
Expand Down Expand Up @@ -90,17 +100,6 @@ syntax cluster typescriptAmbients contains=
\ typescriptModule

syntax keyword typescriptIdentifier arguments nextgroup=@afterIdentifier
syntax match typescriptDefaultImportName /\v\h\k*( |,)/
\ contained
\ nextgroup=typescriptTypeBlock
\ skipwhite skipempty

syntax region typescriptTypeBlock
\ matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contained
\ contains=typescriptIdentifierName,typescriptImportType
\ fold

"Program Keywords
exec 'syntax keyword typescriptNull null '.(exists('g:typescript_conceal_null') ? 'conceal cchar='.g:typescript_conceal_null : '').' nextgroup=@typescriptSymbols skipwhite skipempty'
Expand Down

0 comments on commit 404af73

Please sign in to comment.