File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11import { App } from "../../app/app"
22import { Ripgrep } from "../../file/ripgrep"
33import { LSP } from "../../lsp"
4+ import { Log } from "../../util/log"
45import { bootstrap } from "../bootstrap"
56import { cmd } from "./cmd"
67
@@ -49,7 +50,7 @@ const SymbolsCommand = cmd({
4950 async handler ( args ) {
5051 await bootstrap ( { cwd : process . cwd ( ) } , async ( ) => {
5152 await LSP . touchFile ( "./src/index.ts" , true )
52- await new Promise ( ( resolve ) => setTimeout ( resolve , 3000 ) )
53+ using _ = Log . Default . time ( "symbols" )
5354 const results = await LSP . workspaceSymbol ( args . query )
5455 console . log ( JSON . stringify ( results , null , 2 ) )
5556 } )
Original file line number Diff line number Diff line change @@ -246,6 +246,7 @@ export namespace Provider {
246246 npm : provider . npm ?? existing ?. npm ,
247247 name : provider . name ?? existing ?. name ?? providerID ,
248248 env : provider . env ?? existing ?. env ?? [ ] ,
249+ api : provider . api ?? existing ?. api ,
249250 models : existing ?. models ?? { } ,
250251 }
251252
@@ -288,9 +289,14 @@ export namespace Provider {
288289 // load env
289290 for ( const [ providerID , provider ] of Object . entries ( database ) ) {
290291 if ( disabled . has ( providerID ) ) continue
291- if ( provider . env . some ( ( item ) => process . env [ item ] ) ) {
292- mergeProvider ( providerID , { } , "env" )
293- }
292+ const apiKey = provider . env . map ( ( item ) => process . env [ item ] ) . at ( 0 )
293+ if ( ! apiKey ) continue
294+ mergeProvider (
295+ providerID ,
296+ // only include apiKey if there's only one potential option
297+ provider . env . length === 1 ? { apiKey } : { } ,
298+ "env" ,
299+ )
294300 }
295301
296302 // load apikeys
You can’t perform that action at this time.
0 commit comments