Simplify flow for feeding Q# and QASM instruction files to Copilot#3009
Simplify flow for feeding Q# and QASM instruction files to Copilot#3009joao-boechat wants to merge 6 commits intomainfrom
Conversation
| ): Promise<void> { | ||
| const globalStateUri = context.globalStorageUri; | ||
| const userInvoked = trigger === "Command" || trigger === "Project"; | ||
| const removedConfig = await removeOldCopilotInstructionsConfig(context); |
There was a problem hiding this comment.
Will this remove user's custom instruction files? Do users have a way of migrating their existing custom instructions with this mechanism?
There was a problem hiding this comment.
This shouldn't be a problem given that these files were updated by us and we didn't expect the users to touch them (they were buried deep down in the filesystem). If users want to add custom instructions, they are able to use skills.
@minestarks, thoughts?
There was a problem hiding this comment.
This deletes files from our extension's global storage, which only we manage.
| "chat-instructions", | ||
| ); | ||
|
|
||
| for (const file of ["qsharp.instructions.md", "openqasm.instructions.md"]) { |
There was a problem hiding this comment.
Could you just use the recursive flag and blow away chat-instructions entirely?
| await vscode.workspace.fs.delete(dir); | ||
| result = true; | ||
| } catch { | ||
| // directory doesn't exist or isn't empty |
There was a problem hiding this comment.
Log unexpected errors with log.warn , just so they don't go entirely unnoticed to us developers.
Co-authored-by: Mine Starks <16928427+minestarks@users.noreply.github.com>
This PR addresses issue 2961 by making two key changes:
contributes.chatInstructionsto provide Q# and QASM instructions to Copilot Chat. This ensures that the relevant language instructions are automatically retrieved whenever Copilot is used with Q# or QASM code.vscode/src/gh-copilot/instructions.ts. As part of this change, a cleanup script is introduced and executed on extension activation to remove the old configurations and their persisted files from the user’s filesystem. Additional logging has been added to help track whether this cleanup is still being applied or if the migration has fully rolled out.