File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -146,18 +146,20 @@ export class db2ContextProvider implements IContextProvider {
146
146
) ;
147
147
for ( const table of Object . keys ( tableRefs ) ) {
148
148
const columnData : TableColumn [ ] = tableRefs [ table ] ;
149
- const tableSchema =
150
- columnData . length > 0 ? columnData [ 0 ] . TABLE_SCHEMA : null ;
151
-
152
- // create context item
153
- let prompt = `Db2 for i Table meta data for schema ${ tableSchema } table ${ table } \n` ;
154
- prompt += `Column Info: ${ JSON . stringify ( columnData ) } \n\n` ;
155
-
156
- contextItems . push ( {
157
- name : `${ job . name } -${ tableSchema } -${ table } ` ,
158
- description : `Schema and table information for ${ table } ` ,
159
- content : prompt ,
160
- } ) ;
149
+ if ( columnData && columnData . length > 0 ) {
150
+ const tableSchema =
151
+ columnData . length > 0 ? columnData [ 0 ] . TABLE_SCHEMA : null ;
152
+
153
+ // create context item
154
+ let prompt = `Db2 for i Table meta data for schema ${ tableSchema } table ${ table } \n` ;
155
+ prompt += `Column Info: ${ JSON . stringify ( columnData ) } \n\n` ;
156
+
157
+ contextItems . push ( {
158
+ name : `${ job . name } -${ tableSchema } -${ table } ` ,
159
+ description : `Schema and table information for ${ table } ` ,
160
+ content : prompt ,
161
+ } ) ;
162
+ }
161
163
}
162
164
163
165
return contextItems ;
@@ -195,6 +197,5 @@ export async function registerContinueProvider() {
195
197
const continueAPI = continueEx ?. exports ;
196
198
continueAPI ?. registerCustomContextProvider ( provider ) ;
197
199
vscode . commands . executeCommand ( 'setContext' , 'vscode-db2i:continueExtensionActive' , true ) ;
198
- vscode . window . showInformationMessage ( `@Db2i context provider enabled in Continue!` ) ;
199
200
}
200
201
}
You can’t perform that action at this time.
0 commit comments