| 
									
										
										
										
											2019-06-06 20:39:55 +02:00
										 |  |  | " Vim syntax file | 
					
						
							|  |  |  | " Language:     TypeScript | 
					
						
							| 
									
										
										
										
											2023-08-23 20:23:07 +01:00
										 |  |  | " Maintainer:   Herrington Darkholme | 
					
						
							| 
									
										
										
										
											2024-05-24 18:59:10 +02:00
										 |  |  | " Last Change:  2024 May 24 | 
					
						
							| 
									
										
										
										
											2019-06-06 20:39:55 +02:00
										 |  |  | " Based On:     Herrington Darkholme's yats.vim | 
					
						
							| 
									
										
										
										
											2023-08-23 20:23:07 +01:00
										 |  |  | " Changes:      Go to https://github.com/HerringtonDarkholme/yats.vim for recent changes. | 
					
						
							| 
									
										
										
										
											2019-11-30 17:57:03 +01:00
										 |  |  | " Origin:       https://github.com/othree/yajs | 
					
						
							|  |  |  | " Credits:      Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck | 
					
						
							|  |  |  | "               (This file is based on their hard work), gumnos (From the #vim | 
					
						
							|  |  |  | "               IRC Channel in Freenode) | 
					
						
							| 
									
										
										
										
											2019-06-06 20:39:55 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | " This is the same syntax that is in yats.vim, but: | 
					
						
							|  |  |  | " - flattened into one file | 
					
						
							|  |  |  | " - HiLink commands changed to "hi def link" | 
					
						
							|  |  |  | " - Setting 'cpo' to the Vim value | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if !exists("main_syntax") | 
					
						
							|  |  |  |   if exists("b:current_syntax") | 
					
						
							|  |  |  |     finish | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   let main_syntax = 'typescript' | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-17 15:55:14 +01:00
										 |  |  | " this region is NOT used in TypeScriptReact | 
					
						
							| 
									
										
										
										
											2019-06-06 20:39:55 +02:00
										 |  |  | " nextgroup doesn't contain objectLiteral, let outer region contains it | 
					
						
							|  |  |  | syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets | 
					
						
							|  |  |  |   \ start=/< \@!/ end=/>/ | 
					
						
							|  |  |  |   \ contains=@typescriptType | 
					
						
							|  |  |  |   \ nextgroup=@typescriptExpression | 
					
						
							|  |  |  |   \ contained skipwhite oneline | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-17 15:55:14 +01:00
										 |  |  | """"""""""""""""""""""""""""""""""""""""""""""""""" | 
					
						
							|  |  |  | " Source the part common with typescriptreact.vim | 
					
						
							| 
									
										
										
										
											2022-08-15 18:51:32 +01:00
										 |  |  | source <sfile>:h/shared/typescriptcommon.vim | 
					
						
							| 
									
										
										
										
											2019-06-06 20:39:55 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "typescript" | 
					
						
							|  |  |  | if main_syntax == 'typescript' | 
					
						
							|  |  |  |   unlet main_syntax | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save |