@@ -438,33 +438,24 @@ func (f *file) RefreshIR(ctx context.Context) {
438438 openerMap := map [string ]string {
439439 f .objectInfo .Path (): f .text ,
440440 }
441+ files := []* file {f }
441442 for path , file := range f .importToFile {
442443 openerMap [path ] = file .text
444+ files = append (files , file )
443445 }
444446 opener := source .NewMap (openerMap )
445- f .queryForIR (ctx , opener )
446-
447- for _ , file := range f .importToFile {
448- file .queryForIR (ctx , opener )
449- file .IndexSymbols (ctx )
450- }
451- }
452-
453- func (f * file ) queryForIR (
454- ctx context.Context ,
455- opener source.Opener ,
456- ) {
457- if ! f .ir .IsZero () {
458- return
459- }
447+ session := new (ir.Session )
448+ queries := xslices .Map (files , func (file * file ) incremental.Query [ir.File ] {
449+ return queries.IR {
450+ Opener : opener ,
451+ Path : file .objectInfo .Path (),
452+ Session : session ,
453+ }
454+ })
460455 results , report , err := incremental .Run (
461456 ctx ,
462457 f .lsp .queryExecutor ,
463- queries.IR {
464- Opener : opener ,
465- Path : f .objectInfo .Path (),
466- Session : new (ir.Session ),
467- },
458+ queries ... ,
468459 )
469460 if err != nil {
470461 f .lsp .logger .Error (
@@ -475,8 +466,8 @@ func (f *file) queryForIR(
475466 )
476467 return
477468 }
478- if len ( results ) > 0 {
479- f .ir = results [0 ].Value
469+ for i , file := range files {
470+ file .ir = results [i ].Value
480471 }
481472 diagnostics , err := xslices .MapError (
482473 report .Diagnostics ,
0 commit comments