Skip to content
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
151 changes: 151 additions & 0 deletions generator/lsp.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,42 @@
"since": "3.18.0",
"proposed": true
},
{
"method": "workspace/textDocumentContent",
"typeName": "TextDocumentContentRequest",
"result": {
"kind": "base",
"name": "string"
},
"messageDirection": "clientToServer",
"params": {
"kind": "reference",
"name": "TextDocumentContentParams"
},
"registrationOptions": {
"kind": "reference",
"name": "TextDocumentContentRegistrationOptions"
},
"documentation": "The `workspace/textDocumentContent` request is sent from the client to the\nserver to request the content of a text document.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"method": "workspace/textDocumentContent/refresh",
"typeName": "TextDocumentContentRefreshRequest",
"result": {
"kind": "base",
"name": "null"
},
"messageDirection": "serverToClient",
"params": {
"kind": "reference",
"name": "TextDocumentContentRefreshParams"
},
"documentation": "The `workspace/textDocumentContent` request is sent from the server to the client to refresh\nthe content of a specific text document.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"method": "client/registerCapability",
"typeName": "RegistrationRequest",
Expand Down Expand Up @@ -4368,6 +4404,57 @@
"since": "3.18.0",
"proposed": true
},
{
"name": "TextDocumentContentParams",
"properties": [
{
"name": "uri",
"type": {
"kind": "base",
"name": "DocumentUri"
},
"documentation": "The uri of the text document."
}
],
"documentation": "Parameters for the `workspace/textDocumentContent` request.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "TextDocumentContentRegistrationOptions",
"properties": [],
"extends": [
{
"kind": "reference",
"name": "TextDocumentContentOptions"
}
],
"mixins": [
{
"kind": "reference",
"name": "StaticRegistrationOptions"
}
],
"documentation": "Text document content provider registration options.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "TextDocumentContentRefreshParams",
"properties": [
{
"name": "uri",
"type": {
"kind": "base",
"name": "DocumentUri"
},
"documentation": "The uri of the text document to refresh."
}
],
"documentation": "Parameters for the `workspace/textDocumentContent/refresh` request.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "RegistrationParams",
"properties": [
Expand Down Expand Up @@ -7879,6 +7966,22 @@
"since": "3.18.0",
"proposed": true
},
{
"name": "TextDocumentContentOptions",
"properties": [
{
"name": "scheme",
"type": {
"kind": "base",
"name": "string"
},
"documentation": "The scheme for which the server provides content."
}
],
"documentation": "Text document content provider options.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "Registration",
"properties": [
Expand Down Expand Up @@ -10454,6 +10557,26 @@
"optional": true,
"documentation": "The server is interested in notifications/requests for operations on files.\n\n@since 3.16.0",
"since": "3.16.0"
},
{
"name": "textDocumentContent",
"type": {
"kind": "or",
"items": [
{
"kind": "reference",
"name": "TextDocumentContentOptions"
},
{
"kind": "reference",
"name": "TextDocumentContentRegistrationOptions"
}
]
},
"optional": true,
"documentation": "The server supports the `workspace/textDocumentContent` request.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
}
],
"documentation": "Defines workspace specific capabilities of the server.\n\n@since 3.18.0",
Expand Down Expand Up @@ -10972,6 +11095,17 @@
"documentation": "Capabilities specific to the folding range requests scoped to the workspace.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "textDocumentContent",
"type": {
"kind": "reference",
"name": "TextDocumentContentClientCapabilities"
},
"optional": true,
"documentation": "Capabilities specific to the `workspace/textDocumentContent` request.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
}
],
"documentation": "Workspace specific client capabilities."
Expand Down Expand Up @@ -12084,6 +12218,23 @@
"since": "3.18.0",
"proposed": true
},
{
"name": "TextDocumentContentClientCapabilities",
"properties": [
{
"name": "dynamicRegistration",
"type": {
"kind": "base",
"name": "boolean"
},
"optional": true,
"documentation": "Text document content provider supports dynamic registration."
}
],
"documentation": "Client capabilities for a text document content provider.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "TextDocumentSyncClientCapabilities",
"properties": [
Expand Down
32 changes: 32 additions & 0 deletions packages/python/lsprotocol/_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,22 @@ def _workspace_folder_hook(
return object_
return converter.structure(object_, lsp_types.WorkspaceFolder)

def _text_document_content_hook(
object_: Any, _: type
) -> Union[
OptionalPrimitive,
lsp_types.TextDocumentContentRegistrationOptions,
lsp_types.TextDocumentContentOptions,
]:
if object_ is None:
return None
if "id" in object_:
return converter.structure(
object_, lsp_types.TextDocumentContentRegistrationOptions
)
else:
return converter.structure(object_, lsp_types.TextDocumentContentOptions)

structure_hooks = [
(
Optional[
Expand Down Expand Up @@ -1132,6 +1148,22 @@ def _workspace_folder_hook(
Union[lsp_types.WorkspaceFolder, str],
_workspace_folder_hook,
),
(
Optional[
Union[
lsp_types.TextDocumentContentOptions,
lsp_types.TextDocumentContentRegistrationOptions,
]
],
_text_document_content_hook,
),
(
Union[
lsp_types.TextDocumentContentOptions,
lsp_types.TextDocumentContentRegistrationOptions,
],
_text_document_content_hook,
),
]
for type_, hook in structure_hooks:
converter.register_structure_hook(type_, hook)
Expand Down
Loading