-
Notifications
You must be signed in to change notification settings - Fork 101
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
Copilot chat panel for VS Code #2151
base: main
Are you sure you want to change the base?
Conversation
prompt: "Job name", | ||
value: new Date().toISOString(), | ||
}); | ||
if (!jobName) return; // TODO: Log a telemetry event for this? |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
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.
Not new in this PR
const workspace = await getConversationWorkspace(conversationState); | ||
|
||
const recentJobs = (await getRecentJobs(workspace)).map((job) => { | ||
return { |
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.
Is this different filtering of properties that 'responseJobToJob' in 'workspaceActions.ts'?
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.
That's right. I'll double check this code, but my intention is that GetJobs
returns less details than GetJob
, most importantly by dropping errorData
. errorData
can get very large and fills up input tokens very quickly if we include it in GetJobs
for every job. But we do want to include it when we get details for a single job using GetJob
.
Meanwhile responseJobToJob
drops properties we'll never read such as containerUri
straight off the bat. They just confuse the copilot.
); | ||
} | ||
|
||
class CopilotWebviewViewProvider implements WebviewViewProvider { |
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.
Should this also have a WebviewPanelSerializer? Else do you lose all chat history when you restart VS Code or reload the window? (See WebviewPanel.ts for the existing webviews)
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.
You do lose chat history... I meant that to be a "feature" but we can revisit. I figured most often conversations are pretty short, and intended to do a specific task related to current state of your workspace. So I figured that having a conversation history that's from days ago, including stale details about your workspace, will do more harm than help.
} | ||
|
||
export function getVisibleQSharpDocumentUri(): vscode.Uri | undefined { | ||
return vscode.window.visibleTextEditors.find((editor) => |
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.
If there are several visible, will this return the one that has/had focus? Or just the first one it finds?
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.
Pretty sure it's the first one it finds. Since this is invoked when the user is interacting with the copilot panel, it's actually guaranteed that no Q# editors will have focus. I'll play ground with the multiple-window scenario and see if the behavior makes sense.
The other thought I had is to just give the user an indicator of what the active editor window is, in the copilot panel itself. Like just say "BellState.qs" somewhere in small text. Similar to how the GH Copilot in VS Code shows you which file(s) are in context.
…tarks/copilot-vscode
0cbd900
to
94f8c3d
Compare
This adds a panel to VS Code that provides Copilot chat functionality.
We define a set of client-side tools to be invoked by the model. These tools interface with the user's Azure Quantum workspace, providing a way to submit jobs, get information about the user's jobs and available targets etc.
The panel isn't yet enabled by default. It requires a special configuration to be defined in VS Code settings.