Skip to content

Ensure all messages are JSON rpc payloads #23362

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

Merged
merged 1 commit into from
May 7, 2024

Conversation

DonJayamanne
Copy link

No description provided.

@@ -24,7 +24,7 @@ fn get_env_path(path: &str) -> Option<String> {
fn report_path_python(dispatcher: &mut impl messaging::MessageDispatcher, path: &str) {
let version = utils::get_version(path);
let env_path = get_env_path(path);
dispatcher.send_message(messaging::PythonEnvironment::new(
Copy link
Author

Choose a reason for hiding this comment

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

The send_message is too generic.
Here we're sending PythonEnvironment directly, when instead we should be sending the PythonEnvironmentMessage

Added specific methods to avoid this issue (else the messages sent in the wire wasn't json rpc)

@DonJayamanne DonJayamanne added no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary labels May 7, 2024
@DonJayamanne DonJayamanne requested a review from karthiknadig May 7, 2024 03:47
@karthiknadig
Copy link
Member

I like this approach.

@DonJayamanne DonJayamanne marked this pull request as ready for review May 7, 2024 05:09
@DonJayamanne DonJayamanne merged commit 33dfe29 into native_locator May 7, 2024
69 of 70 checks passed
@DonJayamanne DonJayamanne deleted the jsonRPCAllways branch May 7, 2024 05:09
@vscodenpa vscodenpa added this to the May 2024 milestone May 7, 2024
anthonykim1 pushed a commit to anthonykim1/vscode-python that referenced this pull request May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants