File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 129
129
"default" : " first-interaction" ,
130
130
"description" : " Create the proof view when a Coq script is opened, the user first interacts with coqtop, or else let the user do it manually."
131
131
},
132
+ "coq.proofViewDiff" : {
133
+ "type" : " boolean" ,
134
+ "default" : " true" ,
135
+ "markdownDescription" : " Enable/disable VsCoq's Proof View Diff. Only has acceptable performance on small goals."
136
+ },
132
137
"coq.proofViewDiff.addedTextIsItalic" : {
133
138
"type" : " boolean" ,
134
139
"default" : false ,
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export interface CoqSettings {
77
77
/** After each command, check sentence-states for inconsistencies */
78
78
checkSentenceStateConsistency ?: boolean ,
79
79
}
80
+ proofViewDiff : boolean
80
81
}
81
82
82
83
export interface FailValue {
Original file line number Diff line number Diff line change @@ -420,6 +420,9 @@ export class CoqStateMachine {
420
420
endCommand ( ) ;
421
421
}
422
422
}
423
+ private get proofViewDiff ( ) : boolean {
424
+ return server . project . settings . coq . proofViewDiff
425
+ }
423
426
424
427
/**
425
428
* Return the cached goal for the given position
@@ -429,7 +432,7 @@ export class CoqStateMachine {
429
432
try {
430
433
const state = ( direction === "subsequent" ? this . getStateAt ( pos ) : null ) || this . getPrecedingStateAt ( pos ) ;
431
434
if ( state && state . hasGoal ( ) )
432
- return Object . assign ( { type : 'proof-view' } as { type : 'proof-view' } , state . getGoal ( this . goalsCache ) ) ;
435
+ return Object . assign ( { type : 'proof-view' } as { type : 'proof-view' } , state . getGoal ( this . goalsCache , this . proofViewDiff ) ) ;
433
436
else
434
437
return { type : "no-proof" }
435
438
} catch ( error ) {
@@ -857,7 +860,7 @@ private routeId = 1;
857
860
focus : this . getFocusedPosition ( )
858
861
} ) ;
859
862
this . focusedSentence . setGoal ( pv ) ;
860
- return { type : 'proof-view' , ...this . focusedSentence . getGoal ( this . goalsCache ) } ;
863
+ return { type : 'proof-view' , ...this . focusedSentence . getGoal ( this . goalsCache , this . proofViewDiff ) } ;
861
864
default :
862
865
this . console . warn ( "Goal returned an unexpected value: " + util . inspect ( goals , false , undefined ) ) ;
863
866
}
Original file line number Diff line number Diff line change @@ -191,11 +191,11 @@ export class State {
191
191
this . goal = goal ;
192
192
}
193
193
194
- public getGoal ( goalsCache : GoalsCache ) : ProofView | null {
194
+ public getGoal ( goalsCache : GoalsCache , proofViewDiff : boolean ) : ProofView | null {
195
195
if ( ! this . goal )
196
196
return null ;
197
197
const newGoals = { ...goalsCache . getProofView ( this . goal ) , focus : this . textRange . end } ;
198
- if ( this . prev && this . prev . goal ) {
198
+ if ( this . prev && this . prev . goal && proofViewDiff ) {
199
199
const oldGoals = goalsCache . getProofView ( this . prev . goal ) ;
200
200
return diff . diffProofView ( oldGoals , newGoals ) ;
201
201
}
You can’t perform that action at this time.
0 commit comments