-
Notifications
You must be signed in to change notification settings - Fork 80
feat: send pinned context button immediately with pending state #2060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
server/aws-lsp-codewhisperer/src/language-server/agenticChat/context/contextCommandsProvider.ts
Outdated
Show resolved
Hide resolved
@@ -152,10 +168,12 @@ export class ContextCommandsProvider implements Disposable { | |||
icon: 'image', | |||
placeholder: 'Select an image file', | |||
} | |||
const workspaceCmd = { | |||
|
|||
const workspaceCmd: ContextCommand = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why workspaceCmd was not a ContextCommand before. I think it was handled fine by duck typing but this change would bring better type safety. Can revert back if not necessary for this project
@@ -24,12 +28,27 @@ export class ContextCommandsProvider implements Disposable { | |||
) | |||
} | |||
|
|||
onReady() { | |||
if (!this.initialStateSent) { | |||
this.initialStateSent = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a comment on why this flag is required
Problem
In large workspaces, indexing can take a long time with no indication of status. Also, the "Pin Context" button does not appear until after indexing is complete.
Solution
The "Pin Context" is triggered immediately on startup by sending a file, folder, code, and workspace placeholder set to pending (aws/mynah-ui#421). Then, files/folders, code, and workspace are updated to active once their respective indexing processes are complete.
Should be merged after (first) aws/language-server-runtimes#652 and aws/mynah-ui#421
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.