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

Context provider "Active file" (ex Alt+Enter) doesn't work for unsaved files #2798

Closed
3 tasks done
Astlaan opened this issue Nov 3, 2024 · 5 comments
Closed
3 tasks done
Assignees
Labels
area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority

Comments

@Astlaan
Copy link

Astlaan commented Nov 3, 2024

Before submitting your bug report

Relevant environment info

- OS: Windows
- Continue version: v0.8.55
- IDE version: VS Code 1.95.1

Description

ContextProvider for active file (ex. when submitting prompt about the file in Chat with Alt+Enter) doesn't work for unsaved files. This happens despite the UI saying that it has been passed as context, however it is seen as an Object content, not visible by the model.

This is the behaviour I get:

image

I haven't tested if this is also the case for the Quick Edits (Ctrl+I) since my Ctrl+I isn't working due to another bug (#2346 , #2346 (comment) ).

To reproduce

  1. Open a new file, write some stuff, but don't save to disk
  2. Open Chat, make a query about the file, add the active file as context with Alt+Enter

Log output

No response

@sestinj sestinj self-assigned this Nov 3, 2024
@dosubot dosubot bot added area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Nov 3, 2024
@sestinj
Copy link
Contributor

sestinj commented Nov 5, 2024

Thanks for bringing this up @Astlaan. My guess is that the solution to #1226 will be the same as for this, and it's something we plan to fix later this week

@sestinj sestinj added the priority:medium Indicates medium priority label Nov 5, 2024
@RomneyDa
Copy link
Collaborator

RomneyDa commented Nov 7, 2024

Looks like it does check open text document case here

private async _searchDir(query: string, dir: string): Promise<string> {
const p = child_process.spawn(
path.join(
getExtensionUri().fsPath,
"out",
"node_modules",
"@vscode",

Wondering if path issue, will debug

@RomneyDa
Copy link
Collaborator

RomneyDa commented Nov 7, 2024

just for clarity it does work for unsaved files that already exist, just not for brand new unsaved files like in @Astlaan's case

@RomneyDa
Copy link
Collaborator

RomneyDa commented Nov 8, 2024

Fixed by #2841

@Astlaan
Copy link
Author

Astlaan commented Nov 8, 2024

just for clarity it does work for unsaved files that already exist, just not for brand new unsaved files like in @Astlaan's case

Yes, sorry, could have been clearer

@sestinj sestinj closed this as completed Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior priority:medium Indicates medium priority
Projects
None yet
Development

No branches or pull requests

3 participants