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

DEV2-564 Enhance context gathering in Jupyter notebooks by including text from… #1409

Closed
wants to merge 2 commits into from

Conversation

taltabnine
Copy link

… all cells

… all cells

Signed-off-by: Tal Wertheimer <tal@Tals-MacBook-Pro-2.local>
@taltabnine taltabnine requested a review from a team as a code owner December 13, 2023 16:47
@@ -1,4 +1,5 @@
import { CancellationToken, Position, Range, TextDocument } from "vscode";
import * as vscode from "vscode";
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a named import from vscode one line above, just add the window and the Uri to it

notebookEditor,
document.uri
);
requestData.before = [before, requestData.before].join("\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd prefer an approach that's more "immutable". how about introducing a getContextParts function that returns something like {before: string, after: string}? this function could calculate the 'before' and 'after' based on whether it's a notebook or a regular document, instead of directly mutating the requestData. WDYT?

fix
Signed-off-by: Tal Wertheimer <tal@Tals-MacBook-Pro-2.local>
@taltabnine taltabnine closed this Dec 19, 2023
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