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

prevent native REPL from caching state between sessions #24857

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

Conversation

hutch3232
Copy link

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

@karthiknadig karthiknadig requested a review from anthonykim1 March 5, 2025 15:28
@karthiknadig karthiknadig self-assigned this Mar 5, 2025
@karthiknadig karthiknadig self-requested a review March 5, 2025 15:28
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Mar 5, 2025
@anthonykim1
Copy link

anthonykim1 commented Mar 8, 2025

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

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

when we create Python (REPL) Server on createReplController function.

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

Great work!

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native REPL wrongly caches state from previous session
3 participants