Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ import { registerInlineCompletion } from '../app/inline/completion'
import { AmazonQLspAuth, encryptionKey, notificationTypes } from './auth'
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
import { ConnectionMetadata } from '@aws/language-server-runtimes/protocol'
import { ResourcePaths, Settings, oidcClientName, createServerOptions, globals } from 'aws-core-vscode/shared'
import {
ResourcePaths,
Settings,
oidcClientName,
createServerOptions,
globals,
getLogger,
} from 'aws-core-vscode/shared'

const localize = nls.loadMessageBundle()

Expand Down Expand Up @@ -100,6 +107,16 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
}
})

// Temporary code for pen test. Will be removed when we switch to the real flare auth
const authInterval = setInterval(async () => {
try {
await auth.init()
} catch (e) {
getLogger('amazonqLsp').error('Unable to update bearer token: %s', (e as Error).message)
clearInterval(authInterval)
}
}, 300000) // every 5 minutes

toDispose.push(
AuthUtil.instance.auth.onDidChangeActiveConnection(async () => {
await auth.init()
Expand Down