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

Only pass the id parameter to types that use it #313

Closed

Conversation

dcermak
Copy link
Contributor

@dcermak dcermak commented Jan 23, 2023

Description (e.g. "Related to ...", etc.)

Only pass the id parameter to types that use it

Code review checklist (for code reviewer to complete)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see this for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly
  • CONTRIBUTORS.md was updated, as appropriate
  • Changelog has been updated, as needed (see CHANGELOG.md)

@tombh
Copy link
Collaborator

tombh commented Jan 23, 2023

Thanks for this. Can you give an example of a request without an ID? Does it fail without the ID? Or does it get set as None?

@tombh
Copy link
Collaborator

tombh commented Jan 23, 2023

Right, so the context for this issue is #312

This is ready to merge then. Would you like to add yourself to CONTRIBUTORS.md and update CHANGELOG.md?

@dcermak dcermak force-pushed the dont-add-id-to-all-requests branch from 4f1f433 to 8d15c8b Compare January 23, 2023 15:54
@dcermak
Copy link
Contributor Author

dcermak commented Jan 23, 2023

This is ready to merge then. Would you like to add yourself to CONTRIBUTORS.md and update CHANGELOG.md?

Should be done. Could you approve the CI please?

@nodeg
Copy link

nodeg commented Jul 28, 2023

@tombh Would you mind enabling the GitHub Actions for this PR, please, so we can proceed with it?

@tombh
Copy link
Collaborator

tombh commented Jul 28, 2023

I don't have that option in the UI. I assume that's because it's still in Draft status?

@alcarney
Copy link
Collaborator

alcarney commented Jul 28, 2023

Just repeating what I said in #312, I don't think this PR is necessary.

I would argue that the behavior seen in the original issue is expected as textDocument/didOpen is a notification, not a request (see spec) and that the notify method should be used instead (or even the text_document_did_save method on the new Client when that becomes available)

That said, later on in the same thread @dcermak followed up with

Ah, thank you! I have switched to using notify, which fixes the runtime error, but sadly it creates a new one: The notify function is synchronous, but the processing of that notification happens asynchronously in the background. So the tests that run immediately after that fail, as the document has not yet been loaded. This worked with send_request, albeit of course only accidentally. Can I somehow wait for the result of that notification to be processed?

But that's probably a separate issue around writing tests involving notifications?

@alcarney alcarney closed this Dec 20, 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.

4 participants