File tree Expand file tree Collapse file tree
src/vs/editor/common/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -652,11 +652,15 @@ class ModelSemanticColoring extends Disposable {
652652 this . _isDisposed = false ;
653653 this . _model = model ;
654654 this . _semanticStyling = stylingProvider ;
655- this . _fetchSemanticTokens = this . _register ( new RunOnceScheduler ( ( ) => this . _fetchSemanticTokensNow ( ) , 500 ) ) ;
655+ this . _fetchSemanticTokens = this . _register ( new RunOnceScheduler ( ( ) => this . _fetchSemanticTokensNow ( ) , 300 ) ) ;
656656 this . _currentResponse = null ;
657657 this . _currentRequestCancellationTokenSource = null ;
658658
659- this . _register ( this . _model . onDidChangeContent ( e => this . _fetchSemanticTokens . schedule ( ) ) ) ;
659+ this . _register ( this . _model . onDidChangeContent ( e => {
660+ if ( ! this . _fetchSemanticTokens . isScheduled ( ) ) {
661+ this . _fetchSemanticTokens . schedule ( ) ;
662+ }
663+ } ) ) ;
660664 this . _register ( SemanticTokensProviderRegistry . onDidChange ( e => this . _fetchSemanticTokens . schedule ( ) ) ) ;
661665 if ( themeService ) {
662666 // workaround for tests which use undefined... :/
@@ -887,7 +891,9 @@ class ModelSemanticColoring extends Disposable {
887891 }
888892 }
889893
890- this . _fetchSemanticTokens . schedule ( ) ;
894+ if ( ! this . _fetchSemanticTokens . isScheduled ( ) ) {
895+ this . _fetchSemanticTokens . schedule ( ) ;
896+ }
891897 }
892898
893899 this . _model . setSemanticTokens ( result ) ;
You can’t perform that action at this time.
0 commit comments