Skip to content

Commit

Permalink
docs: update docstrings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alcarney authored and tombh committed Aug 31, 2023
1 parent f97ca46 commit dc97072
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 134 deletions.
16 changes: 12 additions & 4 deletions pygls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,18 @@ def feature(
):
"""Decorator used to register LSP features.
Example:
@ls.feature('window/logMessage')
def completions(ls, params: LogMessageParams):
logger.info("%s", params.message)
Example
-------
::
import logging
from pygls.client import JsonRPCClient
ls = JsonRPCClient()
@ls.feature('window/logMessage')
def completions(ls, params):
logging.info("%s", params.message)
"""
return self.protocol.fm.feature(feature_name, options)

Expand Down
Loading

0 comments on commit dc97072

Please sign in to comment.