Skip to content

Commit

Permalink
docs: Fix get_configuration examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney authored and tombh committed Jan 3, 2023
1 parent ec27730 commit 1801065
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/pages/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ The code snippet below shows how to send configuration to the client:
.. code:: python
def get_configuration(self,
params: ConfigurationParams,
params: WorkspaceConfigurationParams,
callback: Optional[Callable[[List[Any]], None]] = None
) -> asyncio.Future:
# Omitted
Expand All @@ -338,7 +338,7 @@ client, depending on way how the function is registered (described
.. code:: python
# await keyword tells event loop to switch to another task until notification is received
config = await ls.get_configuration(ConfigurationParams(items=[ConfigurationItem(scope_uri='doc_uri_here', section='section')]))
config = await ls.get_configuration(WorkspaceConfigurationParams(items=[ConfigurationItem(scope_uri='doc_uri_here', section='section')]))
- *synchronous* functions

Expand All @@ -348,14 +348,14 @@ client, depending on way how the function is registered (described
def callback(config):
# Omitted
config = ls.get_configuration(ConfigurationParams(items=[ConfigurationItem(scope_uri='doc_uri_here', section='section')]), callback)
config = ls.get_configuration(WorkspaceConfigurationParams(items=[ConfigurationItem(scope_uri='doc_uri_here', section='section')]), callback)
- *threaded* functions

.. code:: python
# .result() will block the thread
config = ls.get_configuration(ConfigurationParams(items=[ConfigurationItem(scope_uri='doc_uri_here', section='section')])).result()
config = ls.get_configuration(WorkspaceConfigurationParams(items=[ConfigurationItem(scope_uri='doc_uri_here', section='section')])).result()
Show Message
^^^^^^^^^^^^
Expand Down

0 comments on commit 1801065

Please sign in to comment.