File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -210,21 +210,15 @@ connection.onHover((params: HoverParams): Hover | null => {
210210
211211connection . onRequest ( "source/publishInfo" , ( info : { [ uri : string ] : Context } ) => {
212212 for ( const [ uri , context ] of Object . entries ( info ) ) {
213- const document = documents . get ( uri ) ;
214- if ( document ) {
215- let oldContext = contextCache . get ( uri ) ;
216- if ( ! oldContext ) {
217- oldContext = context ;
218- contextCache . set ( uri , context ) ;
219- astCache . delete ( uri ) ;
213+ const oldContext = contextCache . get ( uri ) ;
214+ if ( ! oldContext || context . chapter !== oldContext . chapter || context . prepend !== oldContext . prepend ) {
215+ // Context has been added or changed for this URI
216+ contextCache . set ( uri , context ) ;
217+ astCache . delete ( uri ) ;
218+ const document = documents . get ( uri ) ;
219+ if ( document ) {
220220 validateTextDocument ( document )
221221 }
222- // Check if context changed
223- else if ( context . chapter !== oldContext . chapter || context . prepend !== oldContext . prepend ) {
224- contextCache . set ( uri , context ) ;
225- astCache . delete ( uri ) ;
226- validateTextDocument ( document ) ;
227- }
228222 }
229223 }
230224
You can’t perform that action at this time.
0 commit comments