Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

prevent native REPL from caching state between sessions#24857

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
anthonykim1 merged 6 commits intomicrosoft:mainfromhutch3232:issue24359
Apr 2, 2025

Conversation

hutch3232
Copy link

@hutch3232hutch3232 commentedMar 1, 2025
edited by anthonykim1
Loading

Resolves:#24359

Definitely warrants scrutiny / input as I've never written typescript before. Solved with trial and error + LLMs.

@hutch3232
Copy link
Author

@microsoft-github-policy-service agree

@karthiknadigkarthiknadig self-assigned thisMar 5, 2025
@karthiknadigkarthiknadig self-requested a reviewMarch 5, 2025 15:28
@karthiknadigkarthiknadig added the bugIssue identified by VS Code Team member as probable bug labelMar 5, 2025
@anthonykim1
Copy link

anthonykim1 commentedMar 8, 2025
edited
Loading

First of all, nice job and thank you for doing this.

One thing I want to suggest here:

Particularly in regards to:

                    this.pythonServer.dispose();                    this.pythonServer = createPythonServer([this.interpreter.path as string], this.cwd);

After we dispose the "old" Python REPL server directly, we should add the new pythonServer into disposables array,
similar to

constserver=createPythonServer([interpreterPath],cwd);
disposables.push(server);

when we create Python (REPL) Server oncreateReplController function.

So essentially after the above referenced code that you contributed (insrc/client/repl/nativeRepl.ts) could add line this.disposables.push(this.pythonServer);

Great work!

hutch3232 reacted with thumbs up emoji

@hutch3232
Copy link
Author

@anthonykim1 I saw that I had a CI failure due to not having included a test for the new code. I have attempted to add that now.

Full disclosure: I don't know if the test actually works. I had planned to run it before and after applying my proposed fix, but was unable to. I tried very hard to run the test suite but could not get it to go. Even using the included.devcontainer was giving me a lot of issues.

@hutch3232
Copy link
Author

I see my test failed. Looking at this again, I realize I did not do this correctly. simply callingdispose() I don't think is right. I think to correctly do this I would need to simulateworkspace.onDidCloseNotebookDocument event. I could use some guidance on that if possible.

@anthonykim1anthonykim1 self-assigned thisApr 1, 2025
@anthonykim1
Copy link

anthonykim1 commentedApr 1, 2025
edited
Loading

Hi@hutch3232

I've added some test to test out notebook close, along with tracking pythonServer gets called when notebook close event is called.

The key to this was figuring out triggering onDidCloseNotebook event, which signifies repl editor tab closing. Since we can't explicitly cursor click to close the repl tab during testing, we mock this with
notebookCloseEmitter.fire(closingNotebookDocument);

Have a look at the tests, and let me know if you don't understanding anything :)

Thanks.

@anthonykim1anthonykim1 added this to theApril 2025 milestoneApr 1, 2025
@anthonykim1
Copy link

anthonykim1 commentedApr 1, 2025
edited
Loading

FYI to further encourage and enhance future contributions (specific to creating tests and testing them locally), you can click on these different type of run options for tests on yourrun and debug panel, where you see all these different tests you can run.

It's worth pointing out that when you click on the setting gear icon here, it leads to .json tab where you can edit the

"VSC_PYTHON_CI_TEST_GREP": "" // Modify this to run a subset of the single workspace tests

to only run a specific test suite you desire.

For example,

`"VSC_PYTHON_CI_TEST_GREP": "REPL - Native REPL"

would've allowed you to only run the tests in native repl suite locally.

Screenshot 2025-04-01 at 11 28 43 AM

@anthonykim1anthonykim1 merged commit3275c34 intomicrosoft:mainApr 2, 2025
47 of 48 checks passed
@hutch3232
Copy link
Author

@anthonykim1 thank you for your help finishing this! I think I would have struggled to figure all of that out. Anyways, I will try to get the tests working on my end for future development purposes.

anthonykim1 reacted with heart emoji

@anthonykim1
Copy link

you're most welcome@hutch3232 :)
Feel free to directly ping me if you need help in future PRs in the repo.

Thanks for your contribution!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@karthiknadigkarthiknadigkarthiknadig approved these changes

@anthonykim1anthonykim1anthonykim1 approved these changes

Labels
area-replbugIssue identified by VS Code Team member as probable bugskip-issue-check
Projects
None yet
Milestone
April 2025
Development

Successfully merging this pull request may close these issues.

Native REPL wrongly caches state from previous session
3 participants
@hutch3232@anthonykim1@karthiknadig

[8]ページ先頭

©2009-2025 Movatter.jp