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

Update to latest lsprotocol v2024.0.0a2 #487

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Depending on how the handler is registered (see :ref:`here <ls-handlers>`) you c

# await keyword tells event loop to switch to another task until notification is received
config = await ls.get_configuration(
WorkspaceConfigurationParams(
ConfigurationParams(
items=[
ConfigurationItem(scope_uri='doc_uri_here', section='section')
]
Expand All @@ -367,7 +367,7 @@ Depending on how the handler is registered (see :ref:`here <ls-handlers>`) you c
def callback(config):
# Omitted

params = WorkspaceConfigurationParams(
params = ConfigurationParams(
items=[
ConfigurationItem(scope_uri='doc_uri_here', section='section')
]
Expand All @@ -380,7 +380,7 @@ Depending on how the handler is registered (see :ref:`here <ls-handlers>`) you c

# .result() will block the thread
config = ls.get_configuration(
WorkspaceConfigurationParams(
ConfigurationParams(
items=[
ConfigurationItem(scope_uri='doc_uri_here', section='section')
]
Expand Down
6 changes: 3 additions & 3 deletions examples/servers/json_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ async def show_configuration_async(ls: JsonLanguageServer, *args):
"""Gets exampleConfiguration from the client settings using coroutines."""
try:
config = await ls.get_configuration_async(
lsp.WorkspaceConfigurationParams(
lsp.ConfigurationParams(
items=[
lsp.ConfigurationItem(
scope_uri="", section=JsonLanguageServer.CONFIGURATION_SECTION
Expand Down Expand Up @@ -292,7 +292,7 @@ def _config_callback(config):
ls.show_message_log(f"Error ocurred: {e}")

ls.get_configuration(
lsp.WorkspaceConfigurationParams(
lsp.ConfigurationParams(
items=[
lsp.ConfigurationItem(
scope_uri="", section=JsonLanguageServer.CONFIGURATION_SECTION
Expand All @@ -309,7 +309,7 @@ def show_configuration_thread(ls: JsonLanguageServer, *args):
"""Gets exampleConfiguration from the client settings using thread pool."""
try:
config = ls.get_configuration(
lsp.WorkspaceConfigurationParams(
lsp.ConfigurationParams(
items=[
lsp.ConfigurationItem(
scope_uri="", section=JsonLanguageServer.CONFIGURATION_SECTION
Expand Down
2 changes: 1 addition & 1 deletion examples/servers/rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def prepare_rename(ls: RenameLanguageServer, params: types.PrepareRenameParams):
# For simplicity we can tell the client to use its default behaviour however, it's
# relatively new to the spec (LSP v3.16+) so a production server should check the
# client's capabilities before responding in this way
return types.PrepareRenameResult_Type2(default_behavior=True)
return types.PrepareRenameDefaultBehavior(default_behavior=True)


if __name__ == "__main__":
Expand Down
850 changes: 452 additions & 398 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pygls/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ def _with_semantic_tokens(self):
self.server_cap.semantic_tokens_provider = value
return self

full_support: Union[bool, types.SemanticTokensOptionsFullType1] = (
full_support: Union[bool, types.SemanticTokensFullDelta] = (
types.TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL in self.features
)

if types.TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA in self.features:
full_support = types.SemanticTokensOptionsFullType1(delta=True)
full_support = types.SemanticTokensFullDelta(delta=True)

options = types.SemanticTokensOptions(
legend=value,
Expand Down Expand Up @@ -388,7 +388,7 @@ def _with_workspace_capabilities(self):
value = self._provider_options(method_name, default=None)
setattr(file_operations, capability_name, value)

self.server_cap.workspace = types.ServerCapabilitiesWorkspaceType(
self.server_cap.workspace = types.WorkspaceOptions(
workspace_folders=types.WorkspaceFoldersServerCapabilities(
supported=True,
change_notifications=True,
Expand Down
Loading
Loading