Skip to content

show copilot instructions prompt at startup #2361

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

minestarks
Copy link
Member

@minestarks minestarks commented May 2, 2025

Directly invoked by the user via "create Q# project" or "update Copilot instructions for Q#":

image

One-time prompt at startup:

image

@minestarks minestarks requested review from billti and idavis as code owners May 2, 2025 15:16
);

const buttons = [{ title: "Yes" }, { title: "No", isCloseAffordance: true }];
if (!userInvoked) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's user invoked, should we show a confirmation at all, or just update it? It's not like we're doing anything destructive, we only add content. If they explicitly invoked the command, prompting again might be excessive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. My goal in showing the prompt was to help the user understand what they just clicked on. They may have been just poking around in the command palette - without this message, there's nothing telling them what actually happened, and I doubt most users would just know about copilot-instructions.md.

{ title: "Yes" },
{ title: "No", isCloseAffordance: true },
"Add Q# guidance to copilot-instructions.md?\n\n" +
"Updating this file will help GitHub Copilot understand and work better with Q# files and other Quantum Development Kit features.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should add a short-link here for more info. (e.g. aka.ms/qdk.copilot). We can create that to point to the copilot wiki for now, and the official docs later.

@minestarks
Copy link
Member Author

I'm not merging this yet because I want to refine this a little to work better with VS Code Next's support for instructions file. For one, we should be able to drop our own .github/instructions/qsharp.instructions.md in the workspace and avoid having to append to the global copilot-instructions.md . There are other things you can do with settings/user profiles but I can't make up my mind on where exactly we can hook in.

https://github.com/microsoft/vscode-docs/blob/vnext/docs/copilot/copilot-customization.md#specify-custom-instructions-in-settings


// Also do a one-time prompt at startup
if (
context.globalState.get<boolean>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to make this workspaceState since the instructions files are workspace specific

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants