@@ -3,7 +3,7 @@ import { KBA } from "./connectors/kba";
33import { Metagrid } from "./connectors/metagrid" ;
44import { GooglePlaces } from "./connectors/gplaces" ;
55import { GND } from "./connectors/gnd" ;
6- import { Registry , RegistryResult } from './registry' ;
6+ import { Registry , RegistryResult , RegistryResultItem } from './registry' ;
77
88export class RegistryPanel implements vscode . WebviewViewProvider {
99
@@ -90,21 +90,27 @@ export class RegistryPanel implements vscode.WebviewViewProvider {
9090 cancellable : false
9191 } , ( progress ) => {
9292 return new Promise ( async ( resolve ) => {
93- let results :RegistryResult [ ] = [ ] ;
94-
93+ let results :RegistryResultItem [ ] = [ ] ;
94+ let totalItems = 0 ;
9595 if ( register && register !== '' ) {
9696 const plugin = this . _registry . get ( register ) ;
9797 if ( plugin ) {
9898 const result = await plugin . query ( text ) ;
99- results = result ;
99+ results = result . items ;
100+ totalItems = result . totalItems ;
100101 }
101102 } else {
102103 for ( let plugin of this . _registry . values ( ) ) {
103104 const result = await plugin . query ( text ) ;
104- results = results . concat ( result ) ;
105+ totalItems += result . totalItems ;
106+ results = results . concat ( result . items ) ;
105107 }
106108 }
107- this . _view ?. webview . postMessage ( { command : 'results' , data : results , query : text } ) ;
109+ const data :RegistryResult = {
110+ totalItems : totalItems ,
111+ items : results
112+ } ;
113+ this . _view ?. webview . postMessage ( { command : 'results' , data : data , query : text } ) ;
108114 resolve ( true ) ;
109115 } ) ;
110116 } ) ;
@@ -145,6 +151,7 @@ export class RegistryPanel implements vscode.WebviewViewProvider {
145151 <i class="codicon codicon-search"></i>
146152 </button>
147153 </div>
154+ <div id="status">Found <span id="items">0</span> items.</div>
148155 <table class="table">
149156 <tbody id="results"></tbody>
150157 </table>
0 commit comments