Skip to content
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

handle folder references in prompt files #241271

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

legomushroom
Copy link
Member

For https://github.com/microsoft/vscode-copilot/issues/13091.

The PR adds logic to handle folder references inside prompt files. For now it ignores these references - does not provide document links for them(md extension already does that better) and not sending the references to the copilot (not useful).

@legomushroom legomushroom added this to the February 2025 milestone Feb 19, 2025
@legomushroom legomushroom self-assigned this Feb 19, 2025
// validate that the cancellation was not yet requested
assert(
!cancellationToken?.isCancellationRequested,
new CancellationError(),
Copy link
Member

Choose a reason for hiding this comment

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

Creating an error, which involves capturing a stacktrace synchronously, is one of the more costly things one can do in JS. Looks like this isn't a super hot path but it would be good to avoid this pattern (creating an error unnecesarily) proliferating too much.

Copy link
Member Author

Choose a reason for hiding this comment

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

Browser engines optimize these cases pretty well so I would not worry too much about it. On the other hand, this particular case is easy to improve, so will do that in a subsequent PR 👍

@legomushroom legomushroom merged commit 9533503 into main Feb 20, 2025
8 checks passed
@legomushroom legomushroom deleted the legomushroom/prompts/handle-folder-references branch February 20, 2025 07:49
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.

2 participants