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

Rename client objects #359

Merged
merged 8 commits into from
Aug 31, 2023
Merged

Rename client objects #359

merged 8 commits into from
Aug 31, 2023

Conversation

alcarney
Copy link
Collaborator

@alcarney alcarney commented Aug 29, 2023

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

This renames the new client objects to something that better reflects their purpose.

  • In pygls/client.py, Client is now called JsonRPCClient
  • The auto generated LanguageClient in pygls/lsp/client.py is now called BaseLanguageClient

This PR also performs some other house keeping tasks

  • Bump lsprotocol to 2023.0.0a3 which should include all the fixes required for Initial support for notebook document sync methods #356
  • The auto generated client now references LSP types via the types module rather than importing them directly which cuts out the 100s of lines of imports at the top of the file
  • Update the documentation to include reference API documentation for the JsonRPCClient and BaseLanguageClient

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

@alcarney alcarney requested a review from tombh August 29, 2023 22:20
@alcarney alcarney force-pushed the refactor-client branch 3 times, most recently from d953f9d to d2095b0 Compare August 29, 2023 22:36
This should better reflect its purpose as it doesn't do anything by
itself.

Also the `generate_client.py` script now references all lsp types via
`types.X` removing the need for 100s of `from lsprotocol.types import
X` statements.
@alcarney
Copy link
Collaborator Author

@tombh would it be possible to relax commit body length lint?
I'd like to include a url in the commit message but it's triggering the rule.... https://github.com/openlawlibrary/pygls/actions/runs/6018606341/job/16327093410?pr=359#step:7:27

@tombh
Copy link
Collaborator

tombh commented Aug 29, 2023

Sure! Those are just the defaults anyway.

This updates the documentation to include API documentation for the
`JsonRPCClient` and `BaseLanguageClient` using autodoc.

By hooking into the `autodoc-process-docstring` event we can rewrite the
docstrings of the autogenerated methods so that they conform with
reStructuredText syntax and link to the relevant locations.

This also adds a custom `:lsp:` role to the documentation which can be
used to link to sections of the LSP specification.
Tweak the autogenerated client so that the first line of each method's
docstring links to the relevant part of the LSP specification.

Reformat the `JsonRPCClient` example code so that it renders correctly
in Sphinx
@tombh
Copy link
Collaborator

tombh commented Aug 31, 2023

This looks good, actually I mean great, some really nice changes. Let's merge this then?

@alcarney
Copy link
Collaborator Author

Yes, sounds good :)

@tombh tombh merged commit dc97072 into openlawlibrary:main Aug 31, 2023
@alcarney alcarney deleted the refactor-client branch August 31, 2023 16:46
@alcarney alcarney mentioned this pull request Aug 31, 2023
6 tasks
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