@@ -24,6 +24,8 @@ let typeCheckingStatusItem = vscode.window.createStatusBarItem(vscode.StatusBarA
2424let totalityCheckingStatusItem = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left , - 2 )
2525let buildCheckingStatusItem = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left , - 3 )
2626
27+ let killIdrisCounter = 0 ;
28+
2729let init = ( compilerOptions ) => {
2830 if ( compilerOptions ) {
2931 innerCompilerOptions = compilerOptions
@@ -210,6 +212,8 @@ let buildIPKG = (uri) => {
210212
211213let typecheckFile = ( uri ) => {
212214 let needShowOC = vscode . workspace . getConfiguration ( 'idris' ) . get ( 'showOutputWhenTypechecking' )
215+ let limit = vscode . workspace . getConfiguration ( 'idris' ) . get ( 'numbersOfContinuousTypechecking' )
216+
213217 let successHandler = ( _ ) => {
214218 if ( needShowOC ) {
215219 outputChannel . clear ( )
@@ -219,14 +223,24 @@ let typecheckFile = (uri) => {
219223 tcDiagnosticCollection . clear ( )
220224 typeCheckingStatusItem . text = "Idris: Type checking ✔︎"
221225 typeCheckingStatusItem . show ( )
222- destroy ( true )
226+ if ( killIdrisCounter < limit ) {
227+ killIdrisCounter ++
228+ } else {
229+ killIdrisCounter = 0
230+ destroy ( true )
231+ }
223232 }
224233
225234 new Promise ( ( resolve , _reject ) => {
226235 model . load ( uri ) . filter ( ( arg ) => {
227236 return arg . responseType === 'return'
228237 } ) . subscribe ( successHandler , ( err ) => {
229- destroy ( true )
238+ if ( killIdrisCounter < limit ) {
239+ killIdrisCounter ++
240+ } else {
241+ killIdrisCounter = 0
242+ destroy ( true )
243+ }
230244 if ( needShowOC ) {
231245 displayErrors ( err )
232246 }
0 commit comments