This repository was archived by the owner on May 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { HTMLPlugin } from './plugins/HTMLPlugin';
1313import { CSSPlugin } from './plugins/CSSPlugin' ;
1414import { wrapFragmentPlugin } from './api/wrapFragmentPlugin' ;
1515import { TypeScriptPlugin } from './plugins/TypeScriptPlugin' ;
16+ import _ from 'lodash' ;
1617
1718namespace TagCloseRequest {
1819 export const type : RequestType <
@@ -114,13 +115,16 @@ export function startServer() {
114115 manager . getCodeActions ( evt . textDocument , evt . range , evt . context ) ,
115116 ) ;
116117
117- manager . on ( 'documentChange' , async document => {
118- const diagnostics = await manager . getDiagnostics ( { uri : document . getURL ( ) } ) ;
119- connection . sendDiagnostics ( {
120- uri : document . getURL ( ) ,
121- diagnostics,
122- } ) ;
123- } ) ;
118+ manager . on (
119+ 'documentChange' ,
120+ _ . debounce ( async document => {
121+ const diagnostics = await manager . getDiagnostics ( { uri : document . getURL ( ) } ) ;
122+ connection . sendDiagnostics ( {
123+ uri : document . getURL ( ) ,
124+ diagnostics,
125+ } ) ;
126+ } , 500 ) ,
127+ ) ;
124128
125129 connection . listen ( ) ;
126130}
You can’t perform that action at this time.
0 commit comments