File tree Expand file tree Collapse file tree 2 files changed +708
-5
lines changed Expand file tree Collapse file tree 2 files changed +708
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public RegistryOptionsWrapper(ThemeName defaultTheme)
2424 _backend = new RegistryOptions ( defaultTheme ) ;
2525 _extraGrammars = new List < IRawGrammar > ( ) ;
2626
27- string [ ] extraGrammarFiles = [ "toml.json" ] ;
27+ string [ ] extraGrammarFiles = [ "toml.json" , "kotlin.json" ] ;
2828 foreach ( var file in extraGrammarFiles )
2929 {
3030 var asset = AssetLoader . Open ( new Uri ( $ "avares://SourceGit/Resources/Grammars/{ file } ",
@@ -71,16 +71,18 @@ public IRawTheme LoadTheme(ThemeName name)
7171 public string GetScopeByFileName ( string filename )
7272 {
7373 var extension = Path . GetExtension ( filename ) ;
74- var grammar = _extraGrammars . Find ( x => x . GetScopeName ( ) . EndsWith ( extension , StringComparison . OrdinalIgnoreCase ) ) ;
75- if ( grammar != null )
76- return grammar . GetScopeName ( ) ;
77-
7874 if ( extension == ".h" )
7975 extension = ".cpp" ;
8076 else if ( extension == ".resx" || extension == ".plist" || extension == ".manifest" )
8177 extension = ".xml" ;
8278 else if ( extension == ".command" )
8379 extension = ".sh" ;
80+ else if ( extension == ".kt" || extension == ".kts" )
81+ extension = ".kotlin" ;
82+
83+ var grammar = _extraGrammars . Find ( x => x . GetScopeName ( ) . EndsWith ( extension , StringComparison . OrdinalIgnoreCase ) ) ;
84+ if ( grammar != null )
85+ return grammar . GetScopeName ( ) ;
8486
8587 return _backend . GetScopeByExtension ( extension ) ;
8688 }
You can’t perform that action at this time.
0 commit comments