From f4b1a2a0f4f5ab818d3c09ec1f37aa49e7caaa1c Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 9 Jan 2024 11:52:56 -0800 Subject: [PATCH 1/5] Update LSP to latest spec --- generator/lsp.json | 896 ++++++++++++------ generator/plugins/dotnet/dotnet_classes.py | 1 + .../plugins/dotnet/dotnet_special_classes.py | 58 +- packages/python/lsprotocol/types.py | 580 +++++++----- packages/python/requirements.txt | 24 +- packages/rust/lsprotocol/src/lib.rs | 578 +++++++---- requirements.txt | 248 ++--- tests/python/notifications/test_progress.py | 1 + .../test_workspace_symbols_request.py | 1 + tests/python/test_cattrs_special_cases.py | 1 + tests/python/test_custom_validators.py | 3 +- tests/python/test_enums.py | 1 + tests/python/test_generated_data.py | 3 +- tests/python/test_location.py | 1 + tests/python/test_position.py | 1 + tests/python/test_range.py | 1 + 16 files changed, 1556 insertions(+), 842 deletions(-) diff --git a/generator/lsp.json b/generator/lsp.json index c4e7adb..df3aabd 100644 --- a/generator/lsp.json +++ b/generator/lsp.json @@ -1935,6 +1935,10 @@ "name": "DidOpenNotebookDocumentParams" }, "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + }, "documentation": "A notification sent when a notebook opens.\n\n@since 3.17.0", "since": "3.17.0" }, @@ -1945,7 +1949,11 @@ "kind": "reference", "name": "DidChangeNotebookDocumentParams" }, - "registrationMethod": "notebookDocument/sync" + "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + } }, { "method": "notebookDocument/didSave", @@ -1955,6 +1963,10 @@ "name": "DidSaveNotebookDocumentParams" }, "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + }, "documentation": "A notification sent when a notebook document is saved.\n\n@since 3.17.0", "since": "3.17.0" }, @@ -1966,6 +1978,10 @@ "name": "DidCloseNotebookDocumentParams" }, "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + }, "documentation": "A notification sent when a notebook closes.\n\n@since 3.17.0", "since": "3.17.0" }, @@ -2540,7 +2556,7 @@ "name": "FoldingRangeKind" }, "optional": true, - "documentation": "Describes the kind of the folding range such as `comment' or 'region'. The kind\nis used to categorize folding ranges and used by commands like 'Fold all comments'.\nSee {@link FoldingRangeKind} for an enumeration of standardized kinds." + "documentation": "Describes the kind of the folding range such as 'comment' or 'region'. The kind\nis used to categorize folding ranges and used by commands like 'Fold all comments'.\nSee {@link FoldingRangeKind} for an enumeration of standardized kinds." }, { "name": "collapsedText", @@ -3735,7 +3751,7 @@ "kind": "reference", "name": "Position" }, - "documentation": "The position of this hint." + "documentation": "The position of this hint.\n\nIf multiple hints have the same position, they will be shown in the order\nthey appear in the response." }, { "name": "label", @@ -4055,6 +4071,24 @@ "documentation": "The params sent in an open notebook document notification.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "NotebookDocumentSyncRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "NotebookDocumentSyncOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Registration options specific to a notebook.\n\n@since 3.17.0", + "since": "3.17.0" + }, { "name": "DidChangeNotebookDocumentParams", "properties": [ @@ -5095,11 +5129,20 @@ { "name": "activeParameter", "type": { - "kind": "base", - "name": "uinteger" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "null" + } + ] }, "optional": true, - "documentation": "The active parameter of the active signature. If omitted or the value\nlies outside the range of `signatures[activeSignature].parameters`\ndefaults to 0 if the active signature has parameters. If\nthe active signature has no parameters it is ignored.\nIn future version of the protocol this property might become\nmandatory to better express the active parameter if the\nactive signature does have any." + "documentation": "The active parameter of the active signature.\n\nIf `null`, no parameter of the signature is active (for example a named\nargument that does not match any declared parameters). This is only valid\nif the client specifies the client capability\n`textDocument.signatureHelp.noActiveParameterSupport === true`\n\nIf omitted or the value lies outside the range of\n`signatures[activeSignature].parameters` defaults to 0 if the active\nsignature has parameters.\n\nIf the active signature has no parameters it is ignored.\n\nIn future version of the protocol this property might become\nmandatory (but still nullable) to better express the active parameter if\nthe active signature does have any." } ], "documentation": "Signature help represents the signature of something\ncallable. There can be multiple signature but only one\nactive and only one active parameter." @@ -6275,7 +6318,7 @@ "name": "value", "type": { "kind": "reference", - "name": "TraceValues" + "name": "TraceValue" } } ] @@ -7528,8 +7571,8 @@ { "name": "languageId", "type": { - "kind": "base", - "name": "string" + "kind": "reference", + "name": "LanguageKind" }, "documentation": "The text document's language identifier." }, @@ -7552,6 +7595,42 @@ ], "documentation": "An item to transfer a text document from the client to the\nserver." }, + { + "name": "NotebookDocumentSyncOptions", + "properties": [ + { + "name": "notebookSelector", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "NotebookDocumentFilterWithNotebook" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilterWithCells" + } + ] + } + }, + "documentation": "The notebooks to be synced" + }, + { + "name": "save", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether save notification should be forwarded to\nthe server. Will only be honored if mode === `notebook`." + } + ], + "documentation": "Options specific to a notebook plus its cells\nto be synced to the server.\n\nIf a selector provides a notebook document\nfilter but no cell selector all cells of a\nmatching notebook document will be synced.\n\nIf a selector provides no notebook document\nfilter but only a cell selector all notebook\ndocument that contain at least one matching\ncell will be synced.\n\n@since 3.17.0", + "since": "3.17.0" + }, { "name": "VersionedNotebookDocumentIdentifier", "properties": [ @@ -7828,7 +7907,7 @@ "name": "trace", "type": { "kind": "reference", - "name": "TraceValues" + "name": "TraceValue" }, "optional": true, "documentation": "The initial trace setting. If omitted trace is disabled ('off')." @@ -9010,11 +9089,20 @@ { "name": "activeParameter", "type": { - "kind": "base", - "name": "uinteger" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "null" + } + ] }, "optional": true, - "documentation": "The index of the active parameter.\n\nIf provided, this is used in place of `SignatureHelp.activeParameter`.\n\n@since 3.16.0", + "documentation": "The index of the active parameter.\n\nIf `null`, no parameter of the signature is active (for example a named\nargument that does not match any declared parameters). This is only valid\nif the client specifies the client capability\n`textDocument.signatureHelp.noActiveParameterSupport === true`\n\nIf provided (or `null`), this is used in place of\n`SignatureHelp.activeParameter`.\n\n@since 3.16.0", "since": "3.16.0" } ], @@ -9874,6 +9962,80 @@ "documentation": "A notebook cell.\n\nA cell's document URI must be unique across ALL notebook\ncells and can therefore be used to uniquely identify a\nnotebook cell or the cell's text document.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "NotebookDocumentFilterWithNotebook", + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCellLanguage" + } + }, + "optional": true, + "documentation": "The cells of the matching notebook to be synced." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentFilterWithCells", + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "optional": true, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCellLanguage" + } + }, + "documentation": "The cells of the matching notebook to be synced." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "NotebookDocumentCellChanges", "properties": [ @@ -10085,60 +10247,6 @@ } ] }, - { - "name": "NotebookDocumentSyncOptions", - "properties": [ - { - "name": "notebookSelector", - "type": { - "kind": "array", - "element": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "NotebookDocumentFilterWithNotebook" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilterWithCells" - } - ] - } - }, - "documentation": "The notebooks to be synced" - }, - { - "name": "save", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether save notification should be forwarded to\nthe server. Will only be honored if mode === `notebook`." - } - ], - "documentation": "Options specific to a notebook plus its cells\nto be synced to the server.\n\nIf a selector provides a notebook document\nfilter but no cell selector all cells of a\nmatching notebook document will be synced.\n\nIf a selector provides no notebook document\nfilter but only a cell selector all notebook\ndocument that contain at least one matching\ncell will be synced.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocumentSyncRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "NotebookDocumentSyncOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Registration options specific to a notebook.\n\n@since 3.17.0", - "since": "3.17.0" - }, { "name": "WorkspaceOptions", "properties": [ @@ -10438,6 +10546,21 @@ } ] }, + { + "name": "NotebookCellLanguage", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "NotebookDocumentCellChangeStructure", "properties": [ @@ -11056,10 +11179,19 @@ "since": "3.16.0" }, { - "name": "NotebookDocumentFilterWithNotebook", + "name": "WorkspaceFoldersServerCapabilities", "properties": [ { - "name": "notebook", + "name": "supported", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for workspace folders" + }, + { + "name": "changeNotifications", "type": { "kind": "or", "items": [ @@ -11068,91 +11200,8 @@ "name": "string" }, { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "NotebookCellLanguage" - } - }, - "optional": true, - "documentation": "The cells of the matching notebook to be synced." - } - ], - "documentation": "@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - }, - { - "name": "NotebookDocumentFilterWithCells", - "properties": [ - { - "name": "notebook", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "optional": true, - "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "NotebookCellLanguage" - } - }, - "documentation": "The cells of the matching notebook to be synced." - } - ], - "documentation": "@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - }, - { - "name": "WorkspaceFoldersServerCapabilities", - "properties": [ - { - "name": "supported", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server has support for workspace folders" - }, - { - "name": "changeNotifications", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "base", - "name": "boolean" + "kind": "base", + "name": "boolean" } ] }, @@ -11356,6 +11405,108 @@ "since": "3.18.0", "proposed": true }, + { + "name": "NotebookDocumentFilterNotebookType", + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `notebookType` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentFilterScheme", + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `scheme` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentFilterPattern", + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `pattern` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "NotebookCellArrayChange", "properties": [ @@ -12739,8 +12890,8 @@ { "name": "engine", "type": { - "kind": "base", - "name": "string" + "kind": "reference", + "name": "RegularExpressionEngineKind" }, "documentation": "The engine's name." }, @@ -12794,123 +12945,6 @@ "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", "since": "3.16.0" }, - { - "name": "NotebookCellLanguage", - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - } - ], - "documentation": "@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - }, - { - "name": "NotebookDocumentFilterNotebookType", - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ], - "documentation": "A notebook document filter where `notebookType` is required field.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - }, - { - "name": "NotebookDocumentFilterScheme", - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ], - "documentation": "A notebook document filter where `scheme` is required field.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - }, - { - "name": "NotebookDocumentFilterPattern", - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern." - } - ], - "documentation": "A notebook document filter where `pattern` is required field.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - }, { "name": "ChangeAnnotationsSupportOptions", "properties": [ @@ -13165,6 +13199,17 @@ "optional": true, "documentation": "The client supports the `activeParameter` property on `SignatureInformation`\nliteral.\n\n@since 3.16.0", "since": "3.16.0" + }, + { + "name": "noActiveParameterSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports the `activeParameter` property on\n`SignatureHelp`/`SignatureInformation` being set to `null` to\nindicate that no parameter should be active.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true } ], "documentation": "@since 3.18.0\n@proposed", @@ -13978,8 +14023,9 @@ { "name": "Debug", "value": 5, - "documentation": "A debug message.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "A debug message.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true } ], "documentation": "The message type" @@ -14258,6 +14304,13 @@ "value": "refactor.inline", "documentation": "Base kind for refactoring inline actions: 'refactor.inline'\n\nExample inline actions:\n\n- Inline function\n- Inline variable\n- Inline constant\n- ..." }, + { + "name": "RefactorMove", + "value": "refactor.move", + "documentation": "Base kind for refactoring move actions: `refactor.move`\n\nExample move actions:\n\n- Move a function to a new file\n- Move a property between classes\n- Move method to base class\n- ...\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "RefactorRewrite", "value": "refactor.rewrite", @@ -14284,7 +14337,7 @@ "documentation": "A set of predefined code action kinds" }, { - "name": "TraceValues", + "name": "TraceValue", "type": { "kind": "base", "name": "string" @@ -14327,6 +14380,268 @@ ], "documentation": "Describes the content type that a client supports in various\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\nare reserved for internal usage." }, + { + "name": "LanguageKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "ABAP", + "value": "abap" + }, + { + "name": "WindowsBat", + "value": "bat" + }, + { + "name": "BibTeX", + "value": "bibtex" + }, + { + "name": "Clojure", + "value": "clojure" + }, + { + "name": "Coffeescript", + "value": "coffeescript" + }, + { + "name": "C", + "value": "c" + }, + { + "name": "CPP", + "value": "cpp" + }, + { + "name": "CSharp", + "value": "csharp" + }, + { + "name": "CSS", + "value": "css" + }, + { + "name": "D", + "value": "d", + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "Delphi", + "value": "pascal", + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "Diff", + "value": "diff" + }, + { + "name": "Dart", + "value": "dart" + }, + { + "name": "Dockerfile", + "value": "dockerfile" + }, + { + "name": "Elixir", + "value": "elixir" + }, + { + "name": "Erlang", + "value": "erlang" + }, + { + "name": "FSharp", + "value": "fsharp" + }, + { + "name": "GitCommit", + "value": "git-commit" + }, + { + "name": "GitRebase", + "value": "rebase" + }, + { + "name": "Go", + "value": "go" + }, + { + "name": "Groovy", + "value": "groovy" + }, + { + "name": "Handlebars", + "value": "handlebars" + }, + { + "name": "HTML", + "value": "html" + }, + { + "name": "Ini", + "value": "ini" + }, + { + "name": "Java", + "value": "java" + }, + { + "name": "JavaScript", + "value": "javascript" + }, + { + "name": "JavaScriptReact", + "value": "javascriptreact" + }, + { + "name": "JSON", + "value": "json" + }, + { + "name": "LaTeX", + "value": "latex" + }, + { + "name": "Less", + "value": "less" + }, + { + "name": "Lua", + "value": "lua" + }, + { + "name": "Makefile", + "value": "makefile" + }, + { + "name": "Markdown", + "value": "markdown" + }, + { + "name": "ObjectiveC", + "value": "objective-c" + }, + { + "name": "ObjectiveCPP", + "value": "objective-cpp" + }, + { + "name": "Pascal", + "value": "pascal", + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "Perl", + "value": "perl" + }, + { + "name": "Perl6", + "value": "perl6" + }, + { + "name": "PHP", + "value": "php" + }, + { + "name": "Powershell", + "value": "powershell" + }, + { + "name": "Pug", + "value": "jade" + }, + { + "name": "Python", + "value": "python" + }, + { + "name": "R", + "value": "r" + }, + { + "name": "Razor", + "value": "razor" + }, + { + "name": "Ruby", + "value": "ruby" + }, + { + "name": "Rust", + "value": "rust" + }, + { + "name": "SCSS", + "value": "scss" + }, + { + "name": "SASS", + "value": "sass" + }, + { + "name": "Scala", + "value": "scala" + }, + { + "name": "ShaderLab", + "value": "shaderlab" + }, + { + "name": "ShellScript", + "value": "shellscript" + }, + { + "name": "SQL", + "value": "sql" + }, + { + "name": "Swift", + "value": "swift" + }, + { + "name": "TypeScript", + "value": "typescript" + }, + { + "name": "TypeScriptReact", + "value": "typescriptreact" + }, + { + "name": "TeX", + "value": "tex" + }, + { + "name": "VisualBasic", + "value": "vb" + }, + { + "name": "XML", + "value": "xml" + }, + { + "name": "XSL", + "value": "xsl" + }, + { + "name": "YAML", + "value": "yaml" + } + ], + "supportsCustomValues": true, + "documentation": "Predefined Language kinds\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "InlineCompletionTriggerKind", "type": { @@ -14336,12 +14651,12 @@ "values": [ { "name": "Invoked", - "value": 0, + "value": 1, "documentation": "Completion was triggered explicitly by a user gesture." }, { "name": "Automatic", - "value": 1, + "value": 2, "documentation": "Completion was triggered automatically while editing." } ], @@ -15006,15 +15321,6 @@ "documentation": "A document filter denotes a document by different properties like\nthe {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of\nits resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.\n\nGlob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`\n@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`\n\n@since 3.17.0", "since": "3.17.0" }, - { - "name": "Pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", - "since": "3.17.0" - }, { "name": "NotebookDocumentFilter", "type": { @@ -15036,6 +15342,22 @@ }, "documentation": "A notebook document filter denotes a notebook document by\ndifferent properties. The properties will be match\nagainst the notebook's URI (same as with documents)\n\n@since 3.17.0", "since": "3.17.0" + }, + { + "name": "Pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "RegularExpressionEngineKind", + "type": { + "kind": "base", + "name": "string" + } } ] } diff --git a/generator/plugins/dotnet/dotnet_classes.py b/generator/plugins/dotnet/dotnet_classes.py index f1794f3..0d87198 100644 --- a/generator/plugins/dotnet/dotnet_classes.py +++ b/generator/plugins/dotnet/dotnet_classes.py @@ -176,6 +176,7 @@ def get_converter(type_def: model.LSP_TYPE_SPEC, type_name: str) -> Optional[str elif type_def.kind == "reference" and type_def.name in [ "Pattern", "ChangeAnnotationIdentifier", + "RegularExpressionEngineKind", ]: return f"[JsonConverter(typeof(CustomStringConverter<{type_def.name}>))]" elif type_def.kind == "reference" and type_def.name == "DocumentSelector": diff --git a/generator/plugins/dotnet/dotnet_special_classes.py b/generator/plugins/dotnet/dotnet_special_classes.py index 1b8e597..0b9a12a 100644 --- a/generator/plugins/dotnet/dotnet_special_classes.py +++ b/generator/plugins/dotnet/dotnet_special_classes.py @@ -15,6 +15,7 @@ "LSPArray", "ChangeAnnotationIdentifier", "Pattern", + "RegularExpressionEngineKind", "DocumentSelector", "InitializedParams", ] @@ -88,33 +89,38 @@ def generate_special_class( ), ) - if type_def.name == "Pattern": - inner = [ - "private string pattern;", - "public Pattern(string value){pattern = value;}", - "public static implicit operator Pattern(string value) => new Pattern(value);", - "public static implicit operator string(Pattern pattern) => pattern.pattern;", - "public override string ToString() => pattern;", - ] - lines = namespace_wrapper( - NAMESPACE, - get_usings(["JsonConverter", "DataContract"]), - class_wrapper( - type_def, - inner, - None, - [f"[JsonConverter(typeof(CustomStringConverter<{type_def.name}>))]"], - ), - ) + if type_def.name in [ + "Pattern", + "RegularExpressionEngineKind", + "ChangeAnnotationIdentifier", + ]: + if type_def.name == "Pattern": + inner = [ + "private string pattern;", + "public Pattern(string value){pattern = value;}", + "public static implicit operator Pattern(string value) => new Pattern(value);", + "public static implicit operator string(Pattern pattern) => pattern.pattern;", + "public override string ToString() => pattern;", + ] + + if type_def.name == "ChangeAnnotationIdentifier": + inner = [ + "private string identifier;", + "public ChangeAnnotationIdentifier(string value){identifier = value;}", + "public static implicit operator ChangeAnnotationIdentifier(string value) => new ChangeAnnotationIdentifier(value);", + "public static implicit operator string(ChangeAnnotationIdentifier identifier) => identifier.identifier;", + "public override string ToString() => identifier;", + ] + + if type_def.name == "RegularExpressionEngineKind": + inner = [ + "private string engineKind;", + "public RegularExpressionEngineKind(string value){engineKind = value;}", + "public static implicit operator RegularExpressionEngineKind(string value) => new RegularExpressionEngineKind(value);", + "public static implicit operator string(RegularExpressionEngineKind engineKind) => engineKind.engineKind;", + "public override string ToString() => engineKind;", + ] - if type_def.name == "ChangeAnnotationIdentifier": - inner = [ - "private string identifier;", - "public ChangeAnnotationIdentifier(string value){identifier = value;}", - "public static implicit operator ChangeAnnotationIdentifier(string value) => new ChangeAnnotationIdentifier(value);", - "public static implicit operator string(ChangeAnnotationIdentifier identifier) => identifier.identifier;", - "public override string ToString() => identifier;", - ] lines = namespace_wrapper( NAMESPACE, get_usings(["JsonConverter", "DataContract"]), diff --git a/packages/python/lsprotocol/types.py b/packages/python/lsprotocol/types.py index 3c54809..5450a91 100644 --- a/packages/python/lsprotocol/types.py +++ b/packages/python/lsprotocol/types.py @@ -254,8 +254,10 @@ class MessageType(int, enum.Enum): Debug = 5 """A debug message. - @since 3.18.0""" + @since 3.18.0 + @proposed""" # Since: 3.18.0 + # Proposed @enum.unique @@ -413,6 +415,20 @@ class CodeActionKind(str, enum.Enum): - Inline variable - Inline constant - ...""" + RefactorMove = "refactor.move" + """Base kind for refactoring move actions: `refactor.move` + + Example move actions: + + - Move a function to a new file + - Move a property between classes + - Move method to base class + - ... + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed RefactorRewrite = "refactor.rewrite" """Base kind for refactoring rewrite actions: 'refactor.rewrite' @@ -441,7 +457,7 @@ class CodeActionKind(str, enum.Enum): @enum.unique -class TraceValues(str, enum.Enum): +class TraceValue(str, enum.Enum): Off = "off" """Turn tracing off.""" Messages = "messages" @@ -464,6 +480,88 @@ class MarkupKind(str, enum.Enum): """Markdown is supported as a content format""" +@enum.unique +class LanguageKind(str, enum.Enum): + """Predefined Language kinds + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + Abap = "abap" + WindowsBat = "bat" + BibTeX = "bibtex" + Clojure = "clojure" + Coffeescript = "coffeescript" + C = "c" + Cpp = "cpp" + CSharp = "csharp" + Css = "css" + D = "d" + """@since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + Delphi = "pascal" + """@since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + Diff = "diff" + Dart = "dart" + Dockerfile = "dockerfile" + Elixir = "elixir" + Erlang = "erlang" + FSharp = "fsharp" + GitCommit = "git-commit" + GitRebase = "rebase" + Go = "go" + Groovy = "groovy" + Handlebars = "handlebars" + Html = "html" + Ini = "ini" + Java = "java" + JavaScript = "javascript" + JavaScriptReact = "javascriptreact" + Json = "json" + LaTeX = "latex" + Less = "less" + Lua = "lua" + Makefile = "makefile" + Markdown = "markdown" + ObjectiveC = "objective-c" + ObjectiveCpp = "objective-cpp" + Pascal = "pascal" + """@since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + Perl = "perl" + Perl6 = "perl6" + Php = "php" + Powershell = "powershell" + Pug = "jade" + Python = "python" + R = "r" + Razor = "razor" + Ruby = "ruby" + Rust = "rust" + Scss = "scss" + Sass = "sass" + Scala = "scala" + ShaderLab = "shaderlab" + ShellScript = "shellscript" + Sql = "sql" + Swift = "swift" + TypeScript = "typescript" + TypeScriptReact = "typescriptreact" + TeX = "tex" + VisualBasic = "vb" + Xml = "xml" + Xsl = "xsl" + Yaml = "yaml" + + @enum.unique class InlineCompletionTriggerKind(int, enum.Enum): """Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered. @@ -473,9 +571,9 @@ class InlineCompletionTriggerKind(int, enum.Enum): # Since: 3.18.0 # Proposed - Invoked = 0 + Invoked = 1 """Completion was triggered explicitly by a user gesture.""" - Automatic = 1 + Automatic = 2 """Completion was triggered automatically while editing.""" @@ -838,6 +936,19 @@ class LSPObject: # Since: 3.17.0 +NotebookDocumentFilter = Union[ + "NotebookDocumentFilterNotebookType", + "NotebookDocumentFilterScheme", + "NotebookDocumentFilterPattern", +] +"""A notebook document filter denotes a notebook document by +different properties. The properties will be match +against the notebook's URI (same as with documents) + +@since 3.17.0""" +# Since: 3.17.0 + + Pattern = str """The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: - `*` to match one or more characters in a path segment @@ -851,17 +962,7 @@ class LSPObject: # Since: 3.17.0 -NotebookDocumentFilter = Union[ - "NotebookDocumentFilterNotebookType", - "NotebookDocumentFilterScheme", - "NotebookDocumentFilterPattern", -] -"""A notebook document filter denotes a notebook document by -different properties. The properties will be match -against the notebook's URI (same as with documents) - -@since 3.17.0""" -# Since: 3.17.0 +RegularExpressionEngineKind = str @attrs.define @@ -1188,7 +1289,7 @@ class FoldingRange: """The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.""" kind: Optional[Union[FoldingRangeKind, str]] = attrs.field(default=None) - """Describes the kind of the folding range such as `comment' or 'region'. The kind + """Describes the kind of the folding range such as 'comment' or 'region'. The kind is used to categorize folding ranges and used by commands like 'Fold all comments'. See {@link FoldingRangeKind} for an enumeration of standardized kinds.""" @@ -2173,7 +2274,10 @@ class InlayHint: # Since: 3.17.0 position: "Position" = attrs.field() - """The position of this hint.""" + """The position of this hint. + + If multiple hints have the same position, they will be shown in the order + they appear in the response.""" label: Union[str, Sequence["InlayHintLabelPart"]] = attrs.field() """The label of this hint. A human readable string or an array of @@ -2475,6 +2579,65 @@ class DidOpenNotebookDocumentParams: of a notebook cell.""" +@attrs.define +class NotebookDocumentSyncOptions: + """Options specific to a notebook plus its cells + to be synced to the server. + + If a selector provides a notebook document + filter but no cell selector all cells of a + matching notebook document will be synced. + + If a selector provides no notebook document + filter but only a cell selector all notebook + document that contain at least one matching + cell will be synced. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_selector: Sequence[ + Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] + ] = attrs.field() + """The notebooks to be synced""" + + save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether save notification should be forwarded to + the server. Will only be honored if mode === `notebook`.""" + + +@attrs.define +class NotebookDocumentSyncRegistrationOptions: + """Registration options specific to a notebook. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_selector: Sequence[ + Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] + ] = attrs.field() + """The notebooks to be synced""" + + save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether save notification should be forwarded to + the server. Will only be honored if mode === `notebook`.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + @attrs.define class DidChangeNotebookDocumentParams: """The params sent in a change notebook document notification. @@ -2702,7 +2865,7 @@ class _InitializeParams: initialization_options: Optional[LSPAny] = attrs.field(default=None) """User provided initialization options.""" - trace: Optional[TraceValues] = attrs.field(default=None) + trace: Optional[TraceValue] = attrs.field(default=None) """The initial trace setting. If omitted trace is disabled ('off').""" work_done_token: Optional[ProgressToken] = attrs.field(default=None) @@ -2772,7 +2935,7 @@ class InitializeParams: initialization_options: Optional[LSPAny] = attrs.field(default=None) """User provided initialization options.""" - trace: Optional[TraceValues] = attrs.field(default=None) + trace: Optional[TraceValue] = attrs.field(default=None) """The initial trace setting. If omitted trace is disabled ('off').""" work_done_token: Optional[ProgressToken] = attrs.field(default=None) @@ -3446,16 +3609,23 @@ class SignatureHelp: In future version of the protocol this property might become mandatory to better express this.""" - active_parameter: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The active parameter of the active signature. If omitted or the value - lies outside the range of `signatures[activeSignature].parameters` - defaults to 0 if the active signature has parameters. If - the active signature has no parameters it is ignored. + active_parameter: Optional[Union[int, None]] = attrs.field(default=None) + """The active parameter of the active signature. + + If `null`, no parameter of the signature is active (for example a named + argument that does not match any declared parameters). This is only valid + if the client specifies the client capability + `textDocument.signatureHelp.noActiveParameterSupport === true` + + If omitted or the value lies outside the range of + `signatures[activeSignature].parameters` defaults to 0 if the active + signature has parameters. + + If the active signature has no parameters it is ignored. + In future version of the protocol this property might become - mandatory to better express the active parameter if the - active signature does have any.""" + mandatory (but still nullable) to better express the active parameter if + the active signature does have any.""" @attrs.define @@ -4686,7 +4856,7 @@ class WorkDoneProgressEnd: @attrs.define class SetTraceParams: - value: TraceValues = attrs.field() + value: TraceValue = attrs.field() @attrs.define @@ -5397,7 +5567,7 @@ class TextDocumentItem: uri: str = attrs.field(validator=attrs.validators.instance_of(str)) """The text document's uri.""" - language_id: str = attrs.field(validator=attrs.validators.instance_of(str)) + language_id: Union[LanguageKind, str] = attrs.field() """The text document's language identifier.""" version: int = attrs.field(validator=validators.integer_validator) @@ -5550,7 +5720,7 @@ class ServerCapabilities: TextDocumentSyncKind number.""" notebook_document_sync: Optional[ - Union["NotebookDocumentSyncOptions", "NotebookDocumentSyncRegistrationOptions"] + Union[NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions] ] = attrs.field(default=None) """Defines how notebook documents are synced. @@ -6006,12 +6176,16 @@ class SignatureInformation: parameters: Optional[Sequence["ParameterInformation"]] = attrs.field(default=None) """The parameters of this signature.""" - active_parameter: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) + active_parameter: Optional[Union[int, None]] = attrs.field(default=None) """The index of the active parameter. - If provided, this is used in place of `SignatureHelp.activeParameter`. + If `null`, no parameter of the signature is active (for example a named + argument that does not match any declared parameters). This is only valid + if the client specifies the client capability + `textDocument.signatureHelp.noActiveParameterSupport === true` + + If provided (or `null`), this is used in place of + `SignatureHelp.activeParameter`. @since 3.16.0""" # Since: 3.16.0 @@ -6374,6 +6548,40 @@ class NotebookCell: if supported by the client.""" +@attrs.define +class NotebookDocumentFilterWithNotebook: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + notebook: Union[str, NotebookDocumentFilter] = attrs.field() + """The notebook to be synced If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + cells: Optional[Sequence["NotebookCellLanguage"]] = attrs.field(default=None) + """The cells of the matching notebook to be synced.""" + + +@attrs.define +class NotebookDocumentFilterWithCells: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + cells: Sequence["NotebookCellLanguage"] = attrs.field() + """The cells of the matching notebook to be synced.""" + + notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) + """The notebook to be synced If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + @attrs.define class NotebookDocumentCellChanges: """Cell changes to a notebook document. @@ -6503,65 +6711,6 @@ class TextDocumentSyncOptions: sent.""" -@attrs.define -class NotebookDocumentSyncOptions: - """Options specific to a notebook plus its cells - to be synced to the server. - - If a selector provides a notebook document - filter but no cell selector all cells of a - matching notebook document will be synced. - - If a selector provides no notebook document - filter but only a cell selector all notebook - document that contain at least one matching - cell will be synced. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook_selector: Sequence[ - Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] - ] = attrs.field() - """The notebooks to be synced""" - - save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether save notification should be forwarded to - the server. Will only be honored if mode === `notebook`.""" - - -@attrs.define -class NotebookDocumentSyncRegistrationOptions: - """Registration options specific to a notebook. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook_selector: Sequence[ - Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] - ] = attrs.field() - """The notebooks to be synced""" - - save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether save notification should be forwarded to - the server. Will only be honored if mode === `notebook`.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - @attrs.define class WorkspaceOptions: """Defines workspace specific capabilities of the server. @@ -6770,6 +6919,17 @@ class ExecutionSummary: not if known by the client.""" +@attrs.define +class NotebookCellLanguage: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + + @attrs.define class NotebookDocumentCellChangeStructure: """Structural changes to cells in a notebook document. @@ -7211,40 +7371,6 @@ class GeneralClientCapabilities: # Since: 3.17.0 -@attrs.define -class NotebookDocumentFilterWithNotebook: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - cells: Optional[Sequence["NotebookCellLanguage"]] = attrs.field(default=None) - """The cells of the matching notebook to be synced.""" - - -@attrs.define -class NotebookDocumentFilterWithCells: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - cells: Sequence["NotebookCellLanguage"] = attrs.field() - """The cells of the matching notebook to be synced.""" - - notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - @attrs.define class WorkspaceFoldersServerCapabilities: supported: Optional[bool] = attrs.field( @@ -7386,6 +7512,84 @@ class TextDocumentFilterPattern: """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" +@attrs.define +class NotebookDocumentFilterNotebookType: + """A notebook document filter where `notebookType` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The type of the enclosing notebook.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern.""" + + +@attrs.define +class NotebookDocumentFilterScheme: + """A notebook document filter where `scheme` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + notebook_type: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The type of the enclosing notebook.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern.""" + + +@attrs.define +class NotebookDocumentFilterPattern: + """A notebook document filter where `pattern` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A glob pattern.""" + + notebook_type: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The type of the enclosing notebook.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + @attrs.define class NotebookCellArrayChange: """A change describing how to move a `NotebookCell` @@ -8551,7 +8755,7 @@ class RegularExpressionsClientCapabilities: # Since: 3.16.0 - engine: str = attrs.field(validator=attrs.validators.instance_of(str)) + engine: RegularExpressionEngineKind = attrs.field() """The engine's name.""" version: Optional[str] = attrs.field( @@ -8586,95 +8790,6 @@ class MarkdownClientCapabilities: # Since: 3.17.0 -@attrs.define -class NotebookCellLanguage: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class NotebookDocumentFilterNotebookType: - """A notebook document filter where `notebookType` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The type of the enclosing notebook.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern.""" - - -@attrs.define -class NotebookDocumentFilterScheme: - """A notebook document filter where `scheme` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - notebook_type: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The type of the enclosing notebook.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern.""" - - -@attrs.define -class NotebookDocumentFilterPattern: - """A notebook document filter where `pattern` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A glob pattern.""" - - notebook_type: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The type of the enclosing notebook.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - @attrs.define class ChangeAnnotationsSupportOptions: """@since 3.18.0 @@ -8894,6 +9009,19 @@ class ClientSignatureInformationOptions: @since 3.16.0""" # Since: 3.16.0 + no_active_parameter_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports the `activeParameter` property on + `SignatureHelp`/`SignatureInformation` being set to `null` to + indicate that no parameter should be active. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + @attrs.define class ClientCodeActionLiteralOptions: @@ -11641,25 +11769,25 @@ class MessageDirection(enum.Enum): NotebookDocumentDidChangeNotification, None, DidChangeNotebookDocumentParams, - None, + NotebookDocumentSyncRegistrationOptions, ), NOTEBOOK_DOCUMENT_DID_CLOSE: ( NotebookDocumentDidCloseNotification, None, DidCloseNotebookDocumentParams, - None, + NotebookDocumentSyncRegistrationOptions, ), NOTEBOOK_DOCUMENT_DID_OPEN: ( NotebookDocumentDidOpenNotification, None, DidOpenNotebookDocumentParams, - None, + NotebookDocumentSyncRegistrationOptions, ), NOTEBOOK_DOCUMENT_DID_SAVE: ( NotebookDocumentDidSaveNotification, None, DidSaveNotebookDocumentParams, - None, + NotebookDocumentSyncRegistrationOptions, ), PROGRESS: (ProgressNotification, None, ProgressParams, None), SET_TRACE: (SetTraceNotification, None, SetTraceParams, None), @@ -11989,7 +12117,9 @@ def is_keyword_class(cls: type) -> bool: SetTraceNotification, ShutdownRequest, ShutdownResponse, + SignatureHelp, SignatureHelpRegistrationOptions, + SignatureInformation, StringValue, TelemetryEventNotification, TextDocumentChangeRegistrationOptions, @@ -12245,7 +12375,9 @@ def is_special_class(cls: type) -> bool: "ShutdownRequest.method", "ShutdownResponse.jsonrpc", "ShutdownResponse.result", + "SignatureHelp.active_parameter", "SignatureHelpRegistrationOptions.document_selector", + "SignatureInformation.active_parameter", "StringValue.kind", "TelemetryEventNotification.jsonrpc", "TelemetryEventNotification.method", @@ -12800,6 +12932,7 @@ def is_special_property(cls: type, property_name: str) -> bool: "LSPArray": LSPArray, "LSPErrorCodes": LSPErrorCodes, "LSPObject": LSPObject, + "LanguageKind": LanguageKind, "LinkedEditingRangeClientCapabilities": LinkedEditingRangeClientCapabilities, "LinkedEditingRangeOptions": LinkedEditingRangeOptions, "LinkedEditingRangeParams": LinkedEditingRangeParams, @@ -12875,6 +13008,7 @@ def is_special_property(cls: type, property_name: str) -> bool: "ReferenceRegistrationOptions": ReferenceRegistrationOptions, "Registration": Registration, "RegistrationParams": RegistrationParams, + "RegularExpressionEngineKind": RegularExpressionEngineKind, "RegularExpressionsClientCapabilities": RegularExpressionsClientCapabilities, "RelatedFullDocumentDiagnosticReport": RelatedFullDocumentDiagnosticReport, "RelatedUnchangedDocumentDiagnosticReport": RelatedUnchangedDocumentDiagnosticReport, @@ -13073,7 +13207,7 @@ def is_special_property(cls: type, property_name: str) -> bool: "TextDocumentWillSaveWaitUntilResult": TextDocumentWillSaveWaitUntilResult, "TextEdit": TextEdit, "TokenFormat": TokenFormat, - "TraceValues": TraceValues, + "TraceValue": TraceValue, "TypeDefinitionClientCapabilities": TypeDefinitionClientCapabilities, "TypeDefinitionOptions": TypeDefinitionOptions, "TypeDefinitionParams": TypeDefinitionParams, diff --git a/packages/python/requirements.txt b/packages/python/requirements.txt index f9d9405..3eb4339 100644 --- a/packages/python/requirements.txt +++ b/packages/python/requirements.txt @@ -4,21 +4,21 @@ # # pip-compile --generate-hashes ./packages/python/requirements.in # -attrs==23.1.0 \ - --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ - --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 +attrs==23.2.0 \ + --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ + --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 # via # -r ./packages/python/requirements.in # cattrs -cattrs==23.1.2 \ - --hash=sha256:b2bb14311ac17bed0d58785e5a60f022e5431aca3932e3fc5cc8ed8639de50a4 \ - --hash=sha256:db1c821b8c537382b2c7c66678c3790091ca0275ac486c76f3c8f3920e83c657 +cattrs==23.2.3 \ + --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ + --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f # via -r ./packages/python/requirements.in -exceptiongroup==1.1.3 \ - --hash=sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9 \ - --hash=sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3 +exceptiongroup==1.2.0 \ + --hash=sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14 \ + --hash=sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68 # via cattrs -typing-extensions==4.8.0 \ - --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ - --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef +typing-extensions==4.9.0 \ + --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ + --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd # via cattrs diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index 8f81eed..85f383b 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -864,6 +864,8 @@ pub enum MessageType { /// A debug message. /// /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed")] Debug = 5, } impl Serialize for MessageType { @@ -1302,6 +1304,21 @@ pub enum CodeActionKind { #[serde(rename = "refactor.inline")] RefactorInline, + /// Base kind for refactoring move actions: `refactor.move` + /// + /// Example move actions: + /// + /// - Move a function to a new file + /// - Move a property between classes + /// - Move method to base class + /// - ... + /// + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed")] + #[serde(rename = "refactor.move")] + RefactorMove, + /// Base kind for refactoring rewrite actions: 'refactor.rewrite' /// /// Example rewrite actions: @@ -1336,7 +1353,7 @@ pub enum CodeActionKind { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -pub enum TraceValues { +pub enum TraceValue { /// Turn tracing off. #[serde(rename = "off")] Off, @@ -1366,6 +1383,202 @@ pub enum MarkupKind { Markdown, } +/// Predefined Language kinds +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +pub enum LanguageKind { + #[serde(rename = "abap")] + Abap, + + #[serde(rename = "bat")] + WindowsBat, + + #[serde(rename = "bibtex")] + BibTeX, + + #[serde(rename = "clojure")] + Clojure, + + #[serde(rename = "coffeescript")] + Coffeescript, + + #[serde(rename = "c")] + C, + + #[serde(rename = "cpp")] + Cpp, + + #[serde(rename = "csharp")] + Csharp, + + #[serde(rename = "css")] + Css, + + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed")] + #[serde(rename = "d")] + D, + + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed")] + #[serde(rename = "pascal")] + Delphi, + + #[serde(rename = "diff")] + Diff, + + #[serde(rename = "dart")] + Dart, + + #[serde(rename = "dockerfile")] + Dockerfile, + + #[serde(rename = "elixir")] + Elixir, + + #[serde(rename = "erlang")] + Erlang, + + #[serde(rename = "fsharp")] + Fsharp, + + #[serde(rename = "git-commit")] + GitCommit, + + #[serde(rename = "rebase")] + GitRebase, + + #[serde(rename = "go")] + Go, + + #[serde(rename = "groovy")] + Groovy, + + #[serde(rename = "handlebars")] + Handlebars, + + #[serde(rename = "html")] + Html, + + #[serde(rename = "ini")] + Ini, + + #[serde(rename = "java")] + Java, + + #[serde(rename = "javascript")] + JavaScript, + + #[serde(rename = "javascriptreact")] + JavaScriptReact, + + #[serde(rename = "json")] + Json, + + #[serde(rename = "latex")] + LaTeX, + + #[serde(rename = "less")] + Less, + + #[serde(rename = "lua")] + Lua, + + #[serde(rename = "makefile")] + Makefile, + + #[serde(rename = "markdown")] + Markdown, + + #[serde(rename = "objective-c")] + ObjectiveC, + + #[serde(rename = "objective-cpp")] + ObjectiveCpp, + + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed")] + #[serde(rename = "pascal")] + Pascal, + + #[serde(rename = "perl")] + Perl, + + #[serde(rename = "perl6")] + Perl6, + + #[serde(rename = "php")] + Php, + + #[serde(rename = "powershell")] + Powershell, + + #[serde(rename = "jade")] + Pug, + + #[serde(rename = "python")] + Python, + + #[serde(rename = "r")] + R, + + #[serde(rename = "razor")] + Razor, + + #[serde(rename = "ruby")] + Ruby, + + #[serde(rename = "rust")] + Rust, + + #[serde(rename = "scss")] + Scss, + + #[serde(rename = "sass")] + Sass, + + #[serde(rename = "scala")] + Scala, + + #[serde(rename = "shaderlab")] + ShaderLab, + + #[serde(rename = "shellscript")] + ShellScript, + + #[serde(rename = "sql")] + Sql, + + #[serde(rename = "swift")] + Swift, + + #[serde(rename = "typescript")] + TypeScript, + + #[serde(rename = "typescriptreact")] + TypeScriptReact, + + #[serde(rename = "tex")] + TeX, + + #[serde(rename = "vb")] + VisualBasic, + + #[serde(rename = "xml")] + Xml, + + #[serde(rename = "xsl")] + Xsl, + + #[serde(rename = "yaml")] + Yaml, +} + /// Describes how an [inline completion provider][InlineCompletionItemProvider] was triggered. /// /// @since 3.18.0 @@ -1374,10 +1587,10 @@ pub enum MarkupKind { #[derive(PartialEq, Debug, Eq, Clone)] pub enum InlineCompletionTriggerKind { /// Completion was triggered explicitly by a user gesture. - Invoked = 0, + Invoked = 1, /// Completion was triggered automatically while editing. - Automatic = 1, + Automatic = 2, } impl Serialize for InlineCompletionTriggerKind { fn serialize(&self, serializer: S) -> Result @@ -1385,8 +1598,8 @@ impl Serialize for InlineCompletionTriggerKind { S: serde::Serializer, { match self { - InlineCompletionTriggerKind::Invoked => serializer.serialize_i32(0), - InlineCompletionTriggerKind::Automatic => serializer.serialize_i32(1), + InlineCompletionTriggerKind::Invoked => serializer.serialize_i32(1), + InlineCompletionTriggerKind::Automatic => serializer.serialize_i32(2), } } } @@ -1397,8 +1610,8 @@ impl<'de> Deserialize<'de> for InlineCompletionTriggerKind { { let value = i32::deserialize(deserializer)?; match value { - 0 => Ok(InlineCompletionTriggerKind::Invoked), - 1 => Ok(InlineCompletionTriggerKind::Automatic), + 1 => Ok(InlineCompletionTriggerKind::Invoked), + 2 => Ok(InlineCompletionTriggerKind::Automatic), _ => Err(serde::de::Error::custom("Unexpected value")), } } @@ -2011,17 +2224,6 @@ pub enum TextDocumentFilter { Pattern(TextDocumentFilterPattern), } -/// The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: -/// - `*` to match one or more characters in a path segment -/// - `?` to match on one character in a path segment -/// - `**` to match any number of path segments, including none -/// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) -/// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) -/// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) -/// -/// @since 3.17.0 -pub type Pattern = String; - /// A notebook document filter denotes a notebook document by /// different properties. The properties will be match /// against the notebook's URI (same as with documents) @@ -2035,6 +2237,19 @@ pub enum NotebookDocumentFilter { Pattern(NotebookDocumentFilterPattern), } +/// The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: +/// - `*` to match one or more characters in a path segment +/// - `?` to match on one character in a path segment +/// - `**` to match any number of path segments, including none +/// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) +/// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) +/// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) +/// +/// @since 3.17.0 +pub type Pattern = String; + +pub type RegularExpressionEngineKind = String; + #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ImplementationParams { @@ -2266,7 +2481,7 @@ pub struct FoldingRange { /// To be valid, the end must be zero or larger and smaller than the number of lines in the document. pub end_line: u32, - /// Describes the kind of the folding range such as `comment' or 'region'. The kind + /// Describes the kind of the folding range such as 'comment' or 'region'. The kind /// is used to categorize folding ranges and used by commands like 'Fold all comments'. /// See [FoldingRangeKind] for an enumeration of standardized kinds. pub kind: Option>, @@ -3020,6 +3235,9 @@ pub struct InlayHint { pub padding_right: Option, /// The position of this hint. + /// + /// If multiple hints have the same position, they will be shown in the order + /// they appear in the response. pub position: Position, /// Optional text edits that are performed when accepting this inlay hint. @@ -3181,6 +3399,25 @@ pub struct DidOpenNotebookDocumentParams { pub notebook_document: NotebookDocument, } +/// Registration options specific to a notebook. +/// +/// @since 3.17.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentSyncRegistrationOptions { + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + pub id: Option, + + /// The notebooks to be synced + pub notebook_selector: + Vec>, + + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + pub save: Option, +} + /// The params sent in a change notebook document notification. /// /// @since 3.17.0 @@ -3369,7 +3606,7 @@ pub struct InitializeParams { pub root_uri: Option, /// The initial trace setting. If omitted trace is disabled ('off'). - pub trace: Option, + pub trace: Option, /// An optional token that a server can use to report work done progress. pub work_done_token: Option, @@ -3906,13 +4143,22 @@ pub struct SignatureHelpParams { #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelp { - /// The active parameter of the active signature. If omitted or the value - /// lies outside the range of `signatures[activeSignature].parameters` - /// defaults to 0 if the active signature has parameters. If - /// the active signature has no parameters it is ignored. + /// The active parameter of the active signature. + /// + /// If `null`, no parameter of the signature is active (for example a named + /// argument that does not match any declared parameters). This is only valid + /// if the client specifies the client capability + /// `textDocument.signatureHelp.noActiveParameterSupport === true` + /// + /// If omitted or the value lies outside the range of + /// `signatures[activeSignature].parameters` defaults to 0 if the active + /// signature has parameters. + /// + /// If the active signature has no parameters it is ignored. + /// /// In future version of the protocol this property might become - /// mandatory to better express the active parameter if the - /// active signature does have any. + /// mandatory (but still nullable) to better express the active parameter if + /// the active signature does have any. pub active_parameter: Option, /// The active signature. If omitted or the value lies outside the @@ -4763,7 +5009,7 @@ pub struct WorkDoneProgressEnd { #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SetTraceParams { - pub value: TraceValues, + pub value: TraceValue, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -5515,7 +5761,7 @@ pub struct NotebookDocument { #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentItem { /// The text document's language identifier. - pub language_id: String, + pub language_id: CustomStringEnum, /// The content of the opened text document. pub text: String, @@ -5528,6 +5774,31 @@ pub struct TextDocumentItem { pub version: i32, } +/// Options specific to a notebook plus its cells +/// to be synced to the server. +/// +/// If a selector provides a notebook document +/// filter but no cell selector all cells of a +/// matching notebook document will be synced. +/// +/// If a selector provides no notebook document +/// filter but only a cell selector all notebook +/// document that contain at least one matching +/// cell will be synced. +/// +/// @since 3.17.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentSyncOptions { + /// The notebooks to be synced + pub notebook_selector: + Vec>, + + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + pub save: Option, +} + /// A versioned notebook document identifier. /// /// @since 3.17.0 @@ -5690,7 +5961,7 @@ pub struct _InitializeParams { pub root_uri: Option, /// The initial trace setting. If omitted trace is disabled ('off'). - pub trace: Option, + pub trace: Option, /// An optional token that a server can use to report work done progress. pub work_done_token: Option, @@ -6139,7 +6410,13 @@ pub struct SignatureHelpContext { pub struct SignatureInformation { /// The index of the active parameter. /// - /// If provided, this is used in place of `SignatureHelp.activeParameter`. + /// If `null`, no parameter of the signature is active (for example a named + /// argument that does not match any declared parameters). This is only valid + /// if the client specifies the client capability + /// `textDocument.signatureHelp.noActiveParameterSupport === true` + /// + /// If provided (or `null`), this is used in place of + /// `SignatureHelp.activeParameter`. /// /// @since 3.16.0 pub active_parameter: Option, @@ -6646,6 +6923,36 @@ pub struct NotebookCell { pub metadata: Option, } +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentFilterWithNotebook { + /// The cells of the matching notebook to be synced. + pub cells: Option>, + + /// The notebook to be synced If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + pub notebook: OR2, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentFilterWithCells { + /// The cells of the matching notebook to be synced. + pub cells: Vec, + + /// The notebook to be synced If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + pub notebook: Option>, +} + /// Cell changes to a notebook document. /// /// @since 3.18.0 @@ -6748,50 +7055,6 @@ pub struct TextDocumentSyncOptions { pub will_save_wait_until: Option, } -/// Options specific to a notebook plus its cells -/// to be synced to the server. -/// -/// If a selector provides a notebook document -/// filter but no cell selector all cells of a -/// matching notebook document will be synced. -/// -/// If a selector provides no notebook document -/// filter but only a cell selector all notebook -/// document that contain at least one matching -/// cell will be synced. -/// -/// @since 3.17.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentSyncOptions { - /// The notebooks to be synced - pub notebook_selector: - Vec>, - - /// Whether save notification should be forwarded to - /// the server. Will only be honored if mode === `notebook`. - pub save: Option, -} - -/// Registration options specific to a notebook. -/// -/// @since 3.17.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentSyncRegistrationOptions { - /// The id used to register the request. The id can be used to deregister - /// the request again. See also Registration#id. - pub id: Option, - - /// The notebooks to be synced - pub notebook_selector: - Vec>, - - /// Whether save notification should be forwarded to - /// the server. Will only be honored if mode === `notebook`. - pub save: Option, -} - /// Defines workspace specific capabilities of the server. /// /// @since 3.18.0 @@ -6966,6 +7229,15 @@ pub struct ExecutionSummary { pub success: Option, } +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookCellLanguage { + pub language: String, +} + /// Structural changes to cells in a notebook document. /// /// @since 3.18.0 @@ -7287,36 +7559,6 @@ pub struct GeneralClientCapabilities { pub stale_request_support: Option, } -/// @since 3.18.0 -/// @proposed -#[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentFilterWithNotebook { - /// The cells of the matching notebook to be synced. - pub cells: Option>, - - /// The notebook to be synced If a string - /// value is provided it matches against the - /// notebook type. '*' matches every notebook. - pub notebook: OR2, -} - -/// @since 3.18.0 -/// @proposed -#[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentFilterWithCells { - /// The cells of the matching notebook to be synced. - pub cells: Vec, - - /// The notebook to be synced If a string - /// value is provided it matches against the - /// notebook type. '*' matches every notebook. - pub notebook: Option>, -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFoldersServerCapabilities { @@ -7428,6 +7670,60 @@ pub struct TextDocumentFilterPattern { pub scheme: Option, } +/// A notebook document filter where `notebookType` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentFilterNotebookType { + /// The type of the enclosing notebook. + pub notebook_type: String, + + /// A glob pattern. + pub pattern: Option, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: Option, +} + +/// A notebook document filter where `scheme` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentFilterScheme { + /// The type of the enclosing notebook. + pub notebook_type: Option, + + /// A glob pattern. + pub pattern: Option, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: String, +} + +/// A notebook document filter where `pattern` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NotebookDocumentFilterPattern { + /// The type of the enclosing notebook. + pub notebook_type: Option, + + /// A glob pattern. + pub pattern: String, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: Option, +} + /// A change describing how to move a `NotebookCell` /// array from state S to S'. /// @@ -8258,7 +8554,7 @@ pub struct StaleRequestSupportOptions { #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RegularExpressionsClientCapabilities { /// The engine's name. - pub engine: String, + pub engine: RegularExpressionEngineKind, /// The engine's version. pub version: Option, @@ -8283,69 +8579,6 @@ pub struct MarkdownClientCapabilities { pub version: Option, } -/// @since 3.18.0 -/// @proposed -#[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookCellLanguage { - pub language: String, -} - -/// A notebook document filter where `notebookType` is required field. -/// -/// @since 3.18.0 -/// @proposed -#[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentFilterNotebookType { - /// The type of the enclosing notebook. - pub notebook_type: String, - - /// A glob pattern. - pub pattern: Option, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: Option, -} - -/// A notebook document filter where `scheme` is required field. -/// -/// @since 3.18.0 -/// @proposed -#[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentFilterScheme { - /// The type of the enclosing notebook. - pub notebook_type: Option, - - /// A glob pattern. - pub pattern: Option, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: String, -} - -/// A notebook document filter where `pattern` is required field. -/// -/// @since 3.18.0 -/// @proposed -#[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase", deny_unknown_fields)] -pub struct NotebookDocumentFilterPattern { - /// The type of the enclosing notebook. - pub notebook_type: Option, - - /// A glob pattern. - pub pattern: String, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: Option, -} - /// @since 3.18.0 /// @proposed #[cfg(feature = "proposed")] @@ -8509,6 +8742,15 @@ pub struct ClientSignatureInformationOptions { /// property. The order describes the preferred format of the client. pub documentation_format: Option>, + /// The client supports the `activeParameter` property on + /// `SignatureHelp`/`SignatureInformation` being set to `null` to + /// indicate that no parameter should be active. + /// + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed")] + pub no_active_parameter_support: Option, + /// Client capabilities specific to parameter information. pub parameter_information: Option, } diff --git a/requirements.txt b/requirements.txt index 9b38690..47d36e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,25 +4,25 @@ # # pip-compile --generate-hashes ./requirements.in # -attrs==23.1.0 \ - --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ - --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 +attrs==23.2.0 \ + --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ + --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 # via # -r ./requirements.in # cattrs # jsonschema # referencing -cattrs==23.1.2 \ - --hash=sha256:b2bb14311ac17bed0d58785e5a60f022e5431aca3932e3fc5cc8ed8639de50a4 \ - --hash=sha256:db1c821b8c537382b2c7c66678c3790091ca0275ac486c76f3c8f3920e83c657 +cattrs==23.2.3 \ + --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ + --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f # via -r ./requirements.in colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 # via pytest -exceptiongroup==1.1.3 \ - --hash=sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9 \ - --hash=sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3 +exceptiongroup==1.2.0 \ + --hash=sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14 \ + --hash=sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68 # via # cattrs # pytest @@ -37,13 +37,13 @@ iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest -jsonschema==4.19.2 \ - --hash=sha256:c9ff4d7447eed9592c23a12ccee508baf0dd0d59650615e847feb6cdca74f392 \ - --hash=sha256:eee9e502c788e89cb166d4d37f43084e3b64ab405c795c03d343a4dbc2c810fc +jsonschema==4.20.0 \ + --hash=sha256:4f614fd46d8d61258610998997743ec5492a648b33cf478c1ddc23ed4598a5fa \ + --hash=sha256:ed6231f0429ecf966f5bc8dfef245998220549cbbcf140f913b7464c52c3b6b3 # via -r ./requirements.in -jsonschema-specifications==2023.7.1 \ - --hash=sha256:05adf340b659828a004220a9613be00fa3f223f2b82002e273dee62fd50524b1 \ - --hash=sha256:c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb +jsonschema-specifications==2023.12.1 \ + --hash=sha256:48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d1682674764cc \ + --hash=sha256:87e4fdf3a94858b8a2ba2778d9ba57d8a9cafca7c7489c46ba0d30a8bc6a9c3c # via jsonschema packaging==23.2 \ --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ @@ -61,116 +61,116 @@ pyhamcrest==2.1.0 \ --hash=sha256:c6acbec0923d0cb7e72c22af1926f3e7c97b8e8d69fc7498eabacaf7c975bd9c \ --hash=sha256:f6913d2f392e30e0375b3ecbd7aee79e5d1faa25d345c8f4ff597665dcac2587 # via -r ./requirements.in -pytest==7.4.3 \ - --hash=sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac \ - --hash=sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5 +pytest==7.4.4 \ + --hash=sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280 \ + --hash=sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8 # via -r ./requirements.in -referencing==0.30.2 \ - --hash=sha256:449b6669b6121a9e96a7f9e410b245d471e8d48964c67113ce9afe50c8dd7bdf \ - --hash=sha256:794ad8003c65938edcdbc027f1933215e0d0ccc0291e3ce20a4d87432b59efc0 +referencing==0.32.1 \ + --hash=sha256:3c57da0513e9563eb7e203ebe9bb3a1b509b042016433bd1e45a2853466c3dd3 \ + --hash=sha256:7e4dc12271d8e15612bfe35792f5ea1c40970dadf8624602e33db2758f7ee554 # via # jsonschema # jsonschema-specifications -rpds-py==0.12.0 \ - --hash=sha256:0525847f83f506aa1e28eb2057b696fe38217e12931c8b1b02198cfe6975e142 \ - --hash=sha256:05942656cb2cb4989cd50ced52df16be94d344eae5097e8583966a1d27da73a5 \ - --hash=sha256:0831d3ecdea22e4559cc1793f22e77067c9d8c451d55ae6a75bf1d116a8e7f42 \ - --hash=sha256:0853da3d5e9bc6a07b2486054a410b7b03f34046c123c6561b535bb48cc509e1 \ - --hash=sha256:08e6e7ff286254016b945e1ab632ee843e43d45e40683b66dd12b73791366dd1 \ - --hash=sha256:0a38612d07a36138507d69646c470aedbfe2b75b43a4643f7bd8e51e52779624 \ - --hash=sha256:0bedd91ae1dd142a4dc15970ed2c729ff6c73f33a40fa84ed0cdbf55de87c777 \ - --hash=sha256:0c5441b7626c29dbd54a3f6f3713ec8e956b009f419ffdaaa3c80eaf98ddb523 \ - --hash=sha256:0e9e976e0dbed4f51c56db10831c9623d0fd67aac02853fe5476262e5a22acb7 \ - --hash=sha256:0fadfdda275c838cba5102c7f90a20f2abd7727bf8f4a2b654a5b617529c5c18 \ - --hash=sha256:1096ca0bf2d3426cbe79d4ccc91dc5aaa73629b08ea2d8467375fad8447ce11a \ - --hash=sha256:171d9a159f1b2f42a42a64a985e4ba46fc7268c78299272ceba970743a67ee50 \ - --hash=sha256:188912b22b6c8225f4c4ffa020a2baa6ad8fabb3c141a12dbe6edbb34e7f1425 \ - --hash=sha256:1b4cf9ab9a0ae0cb122685209806d3f1dcb63b9fccdf1424fb42a129dc8c2faa \ - --hash=sha256:1e04581c6117ad9479b6cfae313e212fe0dfa226ac727755f0d539cd54792963 \ - --hash=sha256:1fa73ed22c40a1bec98d7c93b5659cd35abcfa5a0a95ce876b91adbda170537c \ - --hash=sha256:2124f9e645a94ab7c853bc0a3644e0ca8ffbe5bb2d72db49aef8f9ec1c285733 \ - --hash=sha256:240687b5be0f91fbde4936a329c9b7589d9259742766f74de575e1b2046575e4 \ - --hash=sha256:25740fb56e8bd37692ed380e15ec734be44d7c71974d8993f452b4527814601e \ - --hash=sha256:27ccc93c7457ef890b0dd31564d2a05e1aca330623c942b7e818e9e7c2669ee4 \ - --hash=sha256:281c8b219d4f4b3581b918b816764098d04964915b2f272d1476654143801aa2 \ - --hash=sha256:2d34a5450a402b00d20aeb7632489ffa2556ca7b26f4a63c35f6fccae1977427 \ - --hash=sha256:301bd744a1adaa2f6a5e06c98f1ac2b6f8dc31a5c23b838f862d65e32fca0d4b \ - --hash=sha256:30e5ce9f501fb1f970e4a59098028cf20676dee64fc496d55c33e04bbbee097d \ - --hash=sha256:33ab498f9ac30598b6406e2be1b45fd231195b83d948ebd4bd77f337cb6a2bff \ - --hash=sha256:35585a8cb5917161f42c2104567bb83a1d96194095fc54a543113ed5df9fa436 \ - --hash=sha256:389c0e38358fdc4e38e9995e7291269a3aead7acfcf8942010ee7bc5baee091c \ - --hash=sha256:3acadbab8b59f63b87b518e09c4c64b142e7286b9ca7a208107d6f9f4c393c5c \ - --hash=sha256:3b7a64d43e2a1fa2dd46b678e00cabd9a49ebb123b339ce799204c44a593ae1c \ - --hash=sha256:3c8c0226c71bd0ce9892eaf6afa77ae8f43a3d9313124a03df0b389c01f832de \ - --hash=sha256:429349a510da82c85431f0f3e66212d83efe9fd2850f50f339341b6532c62fe4 \ - --hash=sha256:466030a42724780794dea71eb32db83cc51214d66ab3fb3156edd88b9c8f0d78 \ - --hash=sha256:47aeceb4363851d17f63069318ba5721ae695d9da55d599b4d6fb31508595278 \ - --hash=sha256:48aa98987d54a46e13e6954880056c204700c65616af4395d1f0639eba11764b \ - --hash=sha256:4b2416ed743ec5debcf61e1242e012652a4348de14ecc7df3512da072b074440 \ - --hash=sha256:4d0a675a7acbbc16179188d8c6d0afb8628604fc1241faf41007255957335a0b \ - --hash=sha256:4eb74d44776b0fb0782560ea84d986dffec8ddd94947f383eba2284b0f32e35e \ - --hash=sha256:4f8a1d990dc198a6c68ec3d9a637ba1ce489b38cbfb65440a27901afbc5df575 \ - --hash=sha256:513ccbf7420c30e283c25c82d5a8f439d625a838d3ba69e79a110c260c46813f \ - --hash=sha256:5210a0018c7e09c75fa788648617ebba861ae242944111d3079034e14498223f \ - --hash=sha256:54cdfcda59251b9c2f87a05d038c2ae02121219a04d4a1e6fc345794295bdc07 \ - --hash=sha256:56dd500411d03c5e9927a1eb55621e906837a83b02350a9dc401247d0353717c \ - --hash=sha256:57ec6baec231bb19bb5fd5fc7bae21231860a1605174b11585660236627e390e \ - --hash=sha256:5f1519b080d8ce0a814f17ad9fb49fb3a1d4d7ce5891f5c85fc38631ca3a8dc4 \ - --hash=sha256:6174d6ad6b58a6bcf67afbbf1723420a53d06c4b89f4c50763d6fa0a6ac9afd2 \ - --hash=sha256:68172622a5a57deb079a2c78511c40f91193548e8ab342c31e8cb0764d362459 \ - --hash=sha256:6915fc9fa6b3ec3569566832e1bb03bd801c12cea030200e68663b9a87974e76 \ - --hash=sha256:6b75b912a0baa033350367a8a07a8b2d44fd5b90c890bfbd063a8a5f945f644b \ - --hash=sha256:6f5dcb658d597410bb7c967c1d24eaf9377b0d621358cbe9d2ff804e5dd12e81 \ - --hash=sha256:6f8d7fe73d1816eeb5378409adc658f9525ecbfaf9e1ede1e2d67a338b0c7348 \ - --hash=sha256:7036316cc26b93e401cedd781a579be606dad174829e6ad9e9c5a0da6e036f80 \ - --hash=sha256:7188ddc1a8887194f984fa4110d5a3d5b9b5cd35f6bafdff1b649049cbc0ce29 \ - --hash=sha256:761531076df51309075133a6bc1db02d98ec7f66e22b064b1d513bc909f29743 \ - --hash=sha256:7979d90ee2190d000129598c2b0c82f13053dba432b94e45e68253b09bb1f0f6 \ - --hash=sha256:8015835494b21aa7abd3b43fdea0614ee35ef6b03db7ecba9beb58eadf01c24f \ - --hash=sha256:81c4d1a3a564775c44732b94135d06e33417e829ff25226c164664f4a1046213 \ - --hash=sha256:81cf9d306c04df1b45971c13167dc3bad625808aa01281d55f3cf852dde0e206 \ - --hash=sha256:88857060b690a57d2ea8569bca58758143c8faa4639fb17d745ce60ff84c867e \ - --hash=sha256:8c567c664fc2f44130a20edac73e0a867f8e012bf7370276f15c6adc3586c37c \ - --hash=sha256:91bd2b7cf0f4d252eec8b7046fa6a43cee17e8acdfc00eaa8b3dbf2f9a59d061 \ - --hash=sha256:9620650c364c01ed5b497dcae7c3d4b948daeae6e1883ae185fef1c927b6b534 \ - --hash=sha256:9b007c2444705a2dc4a525964fd4dd28c3320b19b3410da6517cab28716f27d3 \ - --hash=sha256:9bf9acce44e967a5103fcd820fc7580c7b0ab8583eec4e2051aec560f7b31a63 \ - --hash=sha256:a239303acb0315091d54c7ff36712dba24554993b9a93941cf301391d8a997ee \ - --hash=sha256:a2baa6be130e8a00b6cbb9f18a33611ec150b4537f8563bddadb54c1b74b8193 \ - --hash=sha256:a54917b7e9cd3a67e429a630e237a90b096e0ba18897bfb99ee8bd1068a5fea0 \ - --hash=sha256:a689e1ded7137552bea36305a7a16ad2b40be511740b80748d3140614993db98 \ - --hash=sha256:a952ae3eb460c6712388ac2ec706d24b0e651b9396d90c9a9e0a69eb27737fdc \ - --hash=sha256:aa32205358a76bf578854bf31698a86dc8b2cb591fd1d79a833283f4a403f04b \ - --hash=sha256:b2287c09482949e0ca0c0eb68b2aca6cf57f8af8c6dfd29dcd3bc45f17b57978 \ - --hash=sha256:b6b0e17d39d21698185097652c611f9cf30f7c56ccec189789920e3e7f1cee56 \ - --hash=sha256:b710bf7e7ae61957d5c4026b486be593ed3ec3dca3e5be15e0f6d8cf5d0a4990 \ - --hash=sha256:b8e11715178f3608874508f08e990d3771e0b8c66c73eb4e183038d600a9b274 \ - --hash=sha256:b92aafcfab3d41580d54aca35a8057341f1cfc7c9af9e8bdfc652f83a20ced31 \ - --hash=sha256:bec29b801b4adbf388314c0d050e851d53762ab424af22657021ce4b6eb41543 \ - --hash=sha256:c694bee70ece3b232df4678448fdda245fd3b1bb4ba481fb6cd20e13bb784c46 \ - --hash=sha256:c6b52b7028b547866c2413f614ee306c2d4eafdd444b1ff656bf3295bf1484aa \ - --hash=sha256:cb41ad20064e18a900dd427d7cf41cfaec83bcd1184001f3d91a1f76b3fcea4e \ - --hash=sha256:cd316dbcc74c76266ba94eb021b0cc090b97cca122f50bd7a845f587ff4bf03f \ - --hash=sha256:ced40cdbb6dd47a032725a038896cceae9ce267d340f59508b23537f05455431 \ - --hash=sha256:d1c562a9bb72244fa767d1c1ab55ca1d92dd5f7c4d77878fee5483a22ffac808 \ - --hash=sha256:d389ff1e95b6e46ebedccf7fd1fadd10559add595ac6a7c2ea730268325f832c \ - --hash=sha256:d56b1cd606ba4cedd64bb43479d56580e147c6ef3f5d1c5e64203a1adab784a2 \ - --hash=sha256:d72a4315514e5a0b9837a086cb433b004eea630afb0cc129de76d77654a9606f \ - --hash=sha256:d9e7f29c00577aff6b318681e730a519b235af292732a149337f6aaa4d1c5e31 \ - --hash=sha256:dbc25baa6abb205766fb8606f8263b02c3503a55957fcb4576a6bb0a59d37d10 \ - --hash=sha256:e57919c32ee295a2fca458bb73e4b20b05c115627f96f95a10f9f5acbd61172d \ - --hash=sha256:e5bbe011a2cea9060fef1bb3d668a2fd8432b8888e6d92e74c9c794d3c101595 \ - --hash=sha256:e6aea5c0eb5b0faf52c7b5c4a47c8bb64437173be97227c819ffa31801fa4e34 \ - --hash=sha256:e888be685fa42d8b8a3d3911d5604d14db87538aa7d0b29b1a7ea80d354c732d \ - --hash=sha256:eebaf8c76c39604d52852366249ab807fe6f7a3ffb0dd5484b9944917244cdbe \ - --hash=sha256:efbe0b5e0fd078ed7b005faa0170da4f72666360f66f0bb2d7f73526ecfd99f9 \ - --hash=sha256:efddca2d02254a52078c35cadad34762adbae3ff01c6b0c7787b59d038b63e0d \ - --hash=sha256:f05450fa1cd7c525c0b9d1a7916e595d3041ac0afbed2ff6926e5afb6a781b7f \ - --hash=sha256:f12d69d568f5647ec503b64932874dade5a20255736c89936bf690951a5e79f5 \ - --hash=sha256:f45321224144c25a62052035ce96cbcf264667bcb0d81823b1bbc22c4addd194 \ - --hash=sha256:f62581d7e884dd01ee1707b7c21148f61f2febb7de092ae2f108743fcbef5985 \ - --hash=sha256:f8832a4f83d4782a8f5a7b831c47e8ffe164e43c2c148c8160ed9a6d630bc02a \ - --hash=sha256:fa35ad36440aaf1ac8332b4a4a433d4acd28f1613f0d480995f5cfd3580e90b7 +rpds-py==0.16.2 \ + --hash=sha256:0474df4ade9a3b4af96c3d36eb81856cb9462e4c6657d4caecfd840d2a13f3c9 \ + --hash=sha256:071980663c273bf3d388fe5c794c547e6f35ba3335477072c713a3176bf14a60 \ + --hash=sha256:07aab64e2808c3ebac2a44f67e9dc0543812b715126dfd6fe4264df527556cb6 \ + --hash=sha256:088396c7c70e59872f67462fcac3ecbded5233385797021976a09ebd55961dfe \ + --hash=sha256:162d7cd9cd311c1b0ff1c55a024b8f38bd8aad1876b648821da08adc40e95734 \ + --hash=sha256:19f00f57fdd38db4bb5ad09f9ead1b535332dbf624200e9029a45f1f35527ebb \ + --hash=sha256:1bdbc5fcb04a7309074de6b67fa9bc4b418ab3fc435fec1f2779a0eced688d04 \ + --hash=sha256:1be2f033df1b8be8c3167ba3c29d5dca425592ee31e35eac52050623afba5772 \ + --hash=sha256:24f7a2eb3866a9e91f4599851e0c8d39878a470044875c49bd528d2b9b88361c \ + --hash=sha256:290a81cfbe4673285cdf140ec5cd1658ffbf63ab359f2b352ebe172e7cfa5bf0 \ + --hash=sha256:2946b120718eba9af2b4dd103affc1164a87b9e9ebff8c3e4c05d7b7a7e274e2 \ + --hash=sha256:2bd82db36cd70b3628c0c57d81d2438e8dd4b7b32a6a9f25f24ab0e657cb6c4e \ + --hash=sha256:2ddef620e70eaffebed5932ce754d539c0930f676aae6212f8e16cd9743dd365 \ + --hash=sha256:2e53b9b25cac9065328901713a7e9e3b12e4f57ef4280b370fbbf6fef2052eef \ + --hash=sha256:302bd4983bbd47063e452c38be66153760112f6d3635c7eeefc094299fa400a9 \ + --hash=sha256:349cb40897fd529ca15317c22c0eab67f5ac5178b5bd2c6adc86172045210acc \ + --hash=sha256:358dafc89ce3894c7f486c615ba914609f38277ef67f566abc4c854d23b997fa \ + --hash=sha256:35953f4f2b3216421af86fd236b7c0c65935936a94ea83ddbd4904ba60757773 \ + --hash=sha256:35ae5ece284cf36464eb160880018cf6088a9ac5ddc72292a6092b6ef3f4da53 \ + --hash=sha256:3b811d182ad17ea294f2ec63c0621e7be92a1141e1012383461872cead87468f \ + --hash=sha256:3da5a4c56953bdbf6d04447c3410309616c54433146ccdb4a277b9cb499bc10e \ + --hash=sha256:3dc6a7620ba7639a3db6213da61312cb4aa9ac0ca6e00dc1cbbdc21c2aa6eb57 \ + --hash=sha256:3f91df8e6dbb7360e176d1affd5fb0246d2b88d16aa5ebc7db94fd66b68b61da \ + --hash=sha256:4022b9dc620e14f30201a8a73898a873c8e910cb642bcd2f3411123bc527f6ac \ + --hash=sha256:413b9c17388bbd0d87a329d8e30c1a4c6e44e2bb25457f43725a8e6fe4161e9e \ + --hash=sha256:43d4dd5fb16eb3825742bad8339d454054261ab59fed2fbac84e1d84d5aae7ba \ + --hash=sha256:44627b6ca7308680a70766454db5249105fa6344853af6762eaad4158a2feebe \ + --hash=sha256:44a54e99a2b9693a37ebf245937fd6e9228b4cbd64b9cc961e1f3391ec6c7391 \ + --hash=sha256:47713dc4fce213f5c74ca8a1f6a59b622fc1b90868deb8e8e4d993e421b4b39d \ + --hash=sha256:495a14b72bbe217f2695dcd9b5ab14d4f8066a00f5d209ed94f0aca307f85f6e \ + --hash=sha256:4c46ad6356e1561f2a54f08367d1d2e70a0a1bb2db2282d2c1972c1d38eafc3b \ + --hash=sha256:4d6a9f052e72d493efd92a77f861e45bab2f6be63e37fa8ecf0c6fd1a58fedb0 \ + --hash=sha256:509b617ac787cd1149600e731db9274ebbef094503ca25158e6f23edaba1ca8f \ + --hash=sha256:5552f328eaef1a75ff129d4d0c437bf44e43f9436d3996e8eab623ea0f5fcf73 \ + --hash=sha256:5a80e2f83391ad0808b4646732af2a7b67550b98f0cae056cb3b40622a83dbb3 \ + --hash=sha256:5cf6af100ffb5c195beec11ffaa8cf8523057f123afa2944e6571d54da84cdc9 \ + --hash=sha256:5e6caa3809e50690bd92fa490f5c38caa86082c8c3315aa438bce43786d5e90d \ + --hash=sha256:5ef00873303d678aaf8b0627e111fd434925ca01c657dbb2641410f1cdaef261 \ + --hash=sha256:69ac7ea9897ec201ce68b48582f3eb34a3f9924488a5432a93f177bf76a82a7e \ + --hash=sha256:6a61226465bda9283686db8f17d02569a98e4b13c637be5a26d44aa1f1e361c2 \ + --hash=sha256:6d904c5693e08bad240f16d79305edba78276be87061c872a4a15e2c301fa2c0 \ + --hash=sha256:6dace7b26a13353e24613417ce2239491b40a6ad44e5776a18eaff7733488b44 \ + --hash=sha256:6df15846ee3fb2e6397fe25d7ca6624af9f89587f3f259d177b556fed6bebe2c \ + --hash=sha256:703d95c75a72e902544fda08e965885525e297578317989fd15a6ce58414b41d \ + --hash=sha256:726ac36e8a3bb8daef2fd482534cabc5e17334052447008405daca7ca04a3108 \ + --hash=sha256:781ef8bfc091b19960fc0142a23aedadafa826bc32b433fdfe6fd7f964d7ef44 \ + --hash=sha256:80443fe2f7b3ea3934c5d75fb0e04a5dbb4a8e943e5ff2de0dec059202b70a8b \ + --hash=sha256:83640a5d7cd3bff694747d50436b8b541b5b9b9782b0c8c1688931d6ee1a1f2d \ + --hash=sha256:84c5a4d1f9dd7e2d2c44097fb09fffe728629bad31eb56caf97719e55575aa82 \ + --hash=sha256:882ce6e25e585949c3d9f9abd29202367175e0aab3aba0c58c9abbb37d4982ff \ + --hash=sha256:888a97002e986eca10d8546e3c8b97da1d47ad8b69726dcfeb3e56348ebb28a3 \ + --hash=sha256:8aad80645a011abae487d356e0ceb359f4938dfb6f7bcc410027ed7ae4f7bb8b \ + --hash=sha256:8cb6fe8ecdfffa0e711a75c931fb39f4ba382b4b3ccedeca43f18693864fe850 \ + --hash=sha256:8d6b6937ae9eac6d6c0ca3c42774d89fa311f55adff3970fb364b34abde6ed3d \ + --hash=sha256:90123853fc8b1747f80b0d354be3d122b4365a93e50fc3aacc9fb4c2488845d6 \ + --hash=sha256:96f957d6ab25a78b9e7fc9749d754b98eac825a112b4e666525ce89afcbd9ed5 \ + --hash=sha256:981d135c7cdaf6cd8eadae1c950de43b976de8f09d8e800feed307140d3d6d00 \ + --hash=sha256:9b32f742ce5b57201305f19c2ef7a184b52f6f9ba6871cc042c2a61f0d6b49b8 \ + --hash=sha256:9f0350ef2fba5f34eb0c9000ea328e51b9572b403d2f7f3b19f24085f6f598e8 \ + --hash=sha256:a297a4d08cc67c7466c873c78039d87840fb50d05473db0ec1b7b03d179bf322 \ + --hash=sha256:a3d7e2ea25d3517c6d7e5a1cc3702cffa6bd18d9ef8d08d9af6717fc1c700eed \ + --hash=sha256:a4b682c5775d6a3d21e314c10124599976809455ee67020e8e72df1769b87bc3 \ + --hash=sha256:a4ebb8b20bd09c5ce7884c8f0388801100f5e75e7f733b1b6613c713371feefc \ + --hash=sha256:a61f659665a39a4d17d699ab3593d7116d66e1e2e3f03ef3fb8f484e91908808 \ + --hash=sha256:a9880b4656efe36ccad41edc66789e191e5ee19a1ea8811e0aed6f69851a82f4 \ + --hash=sha256:ac08472f41ea77cd6a5dae36ae7d4ed3951d6602833af87532b556c1b4601d63 \ + --hash=sha256:adc0c3d6fc6ae35fee3e4917628983f6ce630d513cbaad575b4517d47e81b4bb \ + --hash=sha256:af27423662f32d7501a00c5e7342f7dbd1e4a718aea7a239781357d15d437133 \ + --hash=sha256:b2e75e17bd0bb66ee34a707da677e47c14ee51ccef78ed6a263a4cc965a072a1 \ + --hash=sha256:b634c5ec0103c5cbebc24ebac4872b045cccb9456fc59efdcf6fe39775365bd2 \ + --hash=sha256:b6f5549d6ed1da9bfe3631ca9483ae906f21410be2445b73443fa9f017601c6f \ + --hash=sha256:bd4b677d929cf1f6bac07ad76e0f2d5de367e6373351c01a9c0a39f6b21b4a8b \ + --hash=sha256:bf721ede3eb7b829e4a9b8142bd55db0bdc82902720548a703f7e601ee13bdc3 \ + --hash=sha256:c647ca87fc0ebe808a41de912e9a1bfef9acb85257e5d63691364ac16b81c1f0 \ + --hash=sha256:ca57468da2d9a660bcf8961637c85f2fbb2aa64d9bc3f9484e30c3f9f67b1dd7 \ + --hash=sha256:cad0f59ee3dc35526039f4bc23642d52d5f6616b5f687d846bfc6d0d6d486db0 \ + --hash=sha256:cc97f0640e91d7776530f06e6836c546c1c752a52de158720c4224c9e8053cad \ + --hash=sha256:ccd4e400309e1f34a5095bf9249d371f0fd60f8a3a5c4a791cad7b99ce1fd38d \ + --hash=sha256:cffa76b385dfe1e38527662a302b19ffb0e7f5cf7dd5e89186d2c94a22dd9d0c \ + --hash=sha256:d0dd7ed2f16df2e129496e7fbe59a34bc2d7fc8db443a606644d069eb69cbd45 \ + --hash=sha256:d452817e0d9c749c431a1121d56a777bd7099b720b3d1c820f1725cb40928f58 \ + --hash=sha256:d8dda2a806dfa4a9b795950c4f5cc56d6d6159f7d68080aedaff3bdc9b5032f5 \ + --hash=sha256:dcbe1f8dd179e4d69b70b1f1d9bb6fd1e7e1bdc9c9aad345cdeb332e29d40748 \ + --hash=sha256:e0441fb4fdd39a230477b2ca9be90868af64425bfe7b122b57e61e45737a653b \ + --hash=sha256:e04e56b4ca7a770593633556e8e9e46579d66ec2ada846b401252a2bdcf70a6d \ + --hash=sha256:e061de3b745fe611e23cd7318aec2c8b0e4153939c25c9202a5811ca911fd733 \ + --hash=sha256:e93ec1b300acf89730cf27975ef574396bc04edecc358e9bd116fb387a123239 \ + --hash=sha256:e9e557db6a177470316c82f023e5d571811c9a4422b5ea084c85da9aa3c035fc \ + --hash=sha256:eab36eae3f3e8e24b05748ec9acc66286662f5d25c52ad70cadab544e034536b \ + --hash=sha256:ec23fcad480e77ede06cf4127a25fc440f7489922e17fc058f426b5256ee0edb \ + --hash=sha256:ec2e1cf025b2c0f48ec17ff3e642661da7ee332d326f2e6619366ce8e221f018 \ + --hash=sha256:ed99b4f7179d2111702020fd7d156e88acd533f5a7d3971353e568b6051d5c97 \ + --hash=sha256:ee94cb58c0ba2c62ee108c2b7c9131b2c66a29e82746e8fa3aa1a1effbd3dcf1 \ + --hash=sha256:f19afcfc0dd0dca35694df441e9b0f95bc231b512f51bded3c3d8ca32153ec19 \ + --hash=sha256:f1b9d9260e06ea017feb7172976ab261e011c1dc2f8883c7c274f6b2aabfe01a \ + --hash=sha256:f28ac0e8e7242d140f99402a903a2c596ab71550272ae9247ad78f9a932b5698 \ + --hash=sha256:f42e25c016927e2a6b1ce748112c3ab134261fc2ddc867e92d02006103e1b1b7 \ + --hash=sha256:f4bd4578e44f26997e9e56c96dedc5f1af43cc9d16c4daa29c771a00b2a26851 \ + --hash=sha256:f811771019f063bbd0aa7bb72c8a934bc13ebacb4672d712fc1639cfd314cccc # via # jsonschema # referencing @@ -178,9 +178,9 @@ tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f # via pytest -typing-extensions==4.8.0 \ - --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ - --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef +typing-extensions==4.9.0 \ + --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ + --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd # via cattrs zipp==3.17.0 \ --hash=sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31 \ diff --git a/tests/python/notifications/test_progress.py b/tests/python/notifications/test_progress.py index b55e36d..3f7e918 100644 --- a/tests/python/notifications/test_progress.py +++ b/tests/python/notifications/test_progress.py @@ -6,6 +6,7 @@ import hamcrest import jsonrpc import pytest + from lsprotocol.types import ( ProgressNotification, ProgressParams, diff --git a/tests/python/requests/test_workspace_symbols_request.py b/tests/python/requests/test_workspace_symbols_request.py index ceddebb..7d30cbc 100644 --- a/tests/python/requests/test_workspace_symbols_request.py +++ b/tests/python/requests/test_workspace_symbols_request.py @@ -4,6 +4,7 @@ import hamcrest import pytest from cattrs import ClassValidationError + from lsprotocol import converters as cv from lsprotocol import types as lsp diff --git a/tests/python/test_cattrs_special_cases.py b/tests/python/test_cattrs_special_cases.py index cd4512c..c5e0e9c 100644 --- a/tests/python/test_cattrs_special_cases.py +++ b/tests/python/test_cattrs_special_cases.py @@ -7,6 +7,7 @@ import hamcrest import pytest from cattrs.errors import ClassValidationError + from lsprotocol import converters as cv from lsprotocol import types as lsp diff --git a/tests/python/test_custom_validators.py b/tests/python/test_custom_validators.py index b28333d..c7fe1bd 100644 --- a/tests/python/test_custom_validators.py +++ b/tests/python/test_custom_validators.py @@ -1,9 +1,10 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import pytest + import lsprotocol.types as lsp import lsprotocol.validators as v -import pytest @pytest.mark.parametrize( diff --git a/tests/python/test_enums.py b/tests/python/test_enums.py index de97827..3db64c1 100644 --- a/tests/python/test_enums.py +++ b/tests/python/test_enums.py @@ -3,6 +3,7 @@ import hamcrest import pytest + from lsprotocol import types as lsp diff --git a/tests/python/test_generated_data.py b/tests/python/test_generated_data.py index 46a3043..45dbcb2 100644 --- a/tests/python/test_generated_data.py +++ b/tests/python/test_generated_data.py @@ -5,9 +5,10 @@ import pathlib from typing import List, Union +import pytest + import lsprotocol.converters as cv import lsprotocol.types as lsp -import pytest TEST_DATA_ROOT = pathlib.Path(__file__).parent.parent.parent / "packages" / "testdata" diff --git a/tests/python/test_location.py b/tests/python/test_location.py index e65eb3e..1a8cd8f 100644 --- a/tests/python/test_location.py +++ b/tests/python/test_location.py @@ -3,6 +3,7 @@ import hamcrest import pytest + from lsprotocol import types as lsp diff --git a/tests/python/test_position.py b/tests/python/test_position.py index c149579..67bff8b 100644 --- a/tests/python/test_position.py +++ b/tests/python/test_position.py @@ -3,6 +3,7 @@ import hamcrest import pytest + from lsprotocol import types as lsp diff --git a/tests/python/test_range.py b/tests/python/test_range.py index 0a5801b..9977e95 100644 --- a/tests/python/test_range.py +++ b/tests/python/test_range.py @@ -3,6 +3,7 @@ import hamcrest import pytest + from lsprotocol import types as lsp From cb78b29cbc1c1a55b53e4451b20fb234f8ab623a Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 9 Jan 2024 14:22:48 -0800 Subject: [PATCH 2/5] Fix tests --- generator/plugins/python/utils.py | 9 ++++++--- packages/python/lsprotocol/_hooks.py | 6 +++--- packages/python/lsprotocol/types.py | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/generator/plugins/python/utils.py b/generator/plugins/python/utils.py index f963083..2725556 100644 --- a/generator/plugins/python/utils.py +++ b/generator/plugins/python/utils.py @@ -16,7 +16,10 @@ PACKAGE_NAME = "lsprotocol" # These are special type aliases to preserve backward compatibility. -custom_request_params_aliases = [] +CUSTOM_REQUEST_PARAMS_ALIASES = [] + +# Special enums with duplicates +SPECIAL_ENUMS = ["LanguageKind", "ErrorCodes", "LSPErrorCodes"] def generate_from_spec(spec: model.LSPModel, output_dir: str, test_dir: str) -> None: @@ -388,7 +391,7 @@ def _add_type_code(self, type_name: str, code: List[str]) -> None: def _add_enum(self, enum_def: model.Enum) -> None: code_lines = [ - "" if "ErrorCodes" in enum_def.name else "@enum.unique", + "" if enum_def.name in SPECIAL_ENUMS else "@enum.unique", ] if enum_def.type.name == "string": code_lines += [f"class {enum_def.name}(str, enum.Enum):"] @@ -810,7 +813,7 @@ def _add_requests(self, lsp_mode: model.LSPModel) -> None: if request.params: if ( request.params.kind == "reference" - and f"{class_name}Params" in custom_request_params_aliases + and f"{class_name}Params" in CUSTOM_REQUEST_PARAMS_ALIASES ): params_type = f"{class_name}Params" diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index 322a6d8..02199df 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -27,7 +27,7 @@ def _filter(p: Tuple[str, object]) -> bool: items = list(filter(_filter, lsp_types.ALL_TYPES_MAP.items())) for _, value in items: if isinstance(value, type): - attrs.resolve_types(value, lsp_types.ALL_TYPES_MAP, {}) # type: ignore + attrs.resolve_types(value, lsp_types.ALL_TYPES_MAP, {}) _resolved_forward_references = True @@ -1229,7 +1229,7 @@ def _with_custom_unstructure(cls: type) -> Any: ) for a in attrs.fields(cls) } - return cattrs.gen.make_dict_unstructure_fn(cls, converter, **attributes) + return cattrs.gen.make_dict_unstructure_fn(cls, converter, **attributes) # type: ignore def _with_custom_structure(cls: type) -> Any: attributes = { @@ -1239,7 +1239,7 @@ def _with_custom_structure(cls: type) -> Any: ) for a in attrs.fields(cls) } - return cattrs.gen.make_dict_structure_fn(cls, converter, **attributes) + return cattrs.gen.make_dict_structure_fn(cls, converter, **attributes) # type: ignore converter.register_unstructure_hook_factory(attrs.has, _with_custom_unstructure) converter.register_structure_hook_factory(attrs.has, _with_custom_structure) diff --git a/packages/python/lsprotocol/types.py b/packages/python/lsprotocol/types.py index 5450a91..25d40b6 100644 --- a/packages/python/lsprotocol/types.py +++ b/packages/python/lsprotocol/types.py @@ -480,7 +480,6 @@ class MarkupKind(str, enum.Enum): """Markdown is supported as a content format""" -@enum.unique class LanguageKind(str, enum.Enum): """Predefined Language kinds @since 3.18.0 From c7629777a7bdd1072cb5a4de3a4706c7183fea7d Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 9 Jan 2024 15:18:45 -0800 Subject: [PATCH 3/5] Add structuring hook for LanguageKind --- packages/python/lsprotocol/_hooks.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index 02199df..7f4f144 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -722,6 +722,18 @@ def _notebook_sync_registration_option_selector_hook( lsp_types.NotebookDocumentFilterWithCells, ) + def _language_kind_hook( + object_: Any, _: type + ) -> Union[ + lsp_types.LanguageKind, + OptionalPrimitive, + ]: + if object_ is None: + return None + if isinstance(object_, (bool, int, str, float)): + return object_ + return converter.structure(object_, lsp_types.LanguageKind) + structure_hooks = [ ( Optional[ @@ -1063,6 +1075,10 @@ def _notebook_sync_registration_option_selector_hook( ], _symbol_list_hook, ), + ( + Union[lsp_types.LanguageKind, str], + _language_kind_hook, + ), ] for type_, hook in structure_hooks: converter.register_structure_hook(type_, hook) From fa2d96be0020a0751f5833fd68d4d372ca39d9aa Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 9 Jan 2024 15:22:18 -0800 Subject: [PATCH 4/5] Fix linter --- noxfile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 01fbd4a..141db5e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -35,7 +35,10 @@ def lint(session: nox.Session): _install_requirements(session) session.log("Linting: generator and generated Python code.") - session.install("mypy", "ruff") + session.install("mypy", "ruff==0.1.7") + session.run("ruff", "--version") + session.run("mypy", "--version") + session.run("ruff", "check", ".") session.run("ruff", "check", "--select=I001", ".") session.run("ruff", "format", "--check", ".") @@ -54,7 +57,8 @@ def format(session: nox.Session): def _format_code(session: nox.Session): - session.install("ruff") + session.install("ruff==0.1.7") + session.run("ruff", "--version") session.run("ruff", "check", "--fix", "--select=I001", ".") session.run("ruff", "format", ".") From e7886c3dbb61e7c9d17ace9e12f41d4c351e72dc Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 9 Jan 2024 17:45:04 -0800 Subject: [PATCH 5/5] Fix formatting --- noxfile.py | 4 ++-- tests/python/notifications/test_progress.py | 1 - tests/python/requests/test_workspace_symbols_request.py | 1 - tests/python/test_cattrs_special_cases.py | 1 - tests/python/test_custom_validators.py | 3 +-- tests/python/test_enums.py | 1 - tests/python/test_generated_data.py | 3 +-- tests/python/test_location.py | 1 - tests/python/test_position.py | 1 - tests/python/test_range.py | 1 - 10 files changed, 4 insertions(+), 13 deletions(-) diff --git a/noxfile.py b/noxfile.py index 141db5e..e495741 100644 --- a/noxfile.py +++ b/noxfile.py @@ -35,7 +35,7 @@ def lint(session: nox.Session): _install_requirements(session) session.log("Linting: generator and generated Python code.") - session.install("mypy", "ruff==0.1.7") + session.install("mypy", "ruff") session.run("ruff", "--version") session.run("mypy", "--version") @@ -57,7 +57,7 @@ def format(session: nox.Session): def _format_code(session: nox.Session): - session.install("ruff==0.1.7") + session.install("ruff") session.run("ruff", "--version") session.run("ruff", "check", "--fix", "--select=I001", ".") diff --git a/tests/python/notifications/test_progress.py b/tests/python/notifications/test_progress.py index 3f7e918..b55e36d 100644 --- a/tests/python/notifications/test_progress.py +++ b/tests/python/notifications/test_progress.py @@ -6,7 +6,6 @@ import hamcrest import jsonrpc import pytest - from lsprotocol.types import ( ProgressNotification, ProgressParams, diff --git a/tests/python/requests/test_workspace_symbols_request.py b/tests/python/requests/test_workspace_symbols_request.py index 7d30cbc..ceddebb 100644 --- a/tests/python/requests/test_workspace_symbols_request.py +++ b/tests/python/requests/test_workspace_symbols_request.py @@ -4,7 +4,6 @@ import hamcrest import pytest from cattrs import ClassValidationError - from lsprotocol import converters as cv from lsprotocol import types as lsp diff --git a/tests/python/test_cattrs_special_cases.py b/tests/python/test_cattrs_special_cases.py index c5e0e9c..cd4512c 100644 --- a/tests/python/test_cattrs_special_cases.py +++ b/tests/python/test_cattrs_special_cases.py @@ -7,7 +7,6 @@ import hamcrest import pytest from cattrs.errors import ClassValidationError - from lsprotocol import converters as cv from lsprotocol import types as lsp diff --git a/tests/python/test_custom_validators.py b/tests/python/test_custom_validators.py index c7fe1bd..b28333d 100644 --- a/tests/python/test_custom_validators.py +++ b/tests/python/test_custom_validators.py @@ -1,10 +1,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -import pytest - import lsprotocol.types as lsp import lsprotocol.validators as v +import pytest @pytest.mark.parametrize( diff --git a/tests/python/test_enums.py b/tests/python/test_enums.py index 3db64c1..de97827 100644 --- a/tests/python/test_enums.py +++ b/tests/python/test_enums.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp diff --git a/tests/python/test_generated_data.py b/tests/python/test_generated_data.py index 45dbcb2..46a3043 100644 --- a/tests/python/test_generated_data.py +++ b/tests/python/test_generated_data.py @@ -5,10 +5,9 @@ import pathlib from typing import List, Union -import pytest - import lsprotocol.converters as cv import lsprotocol.types as lsp +import pytest TEST_DATA_ROOT = pathlib.Path(__file__).parent.parent.parent / "packages" / "testdata" diff --git a/tests/python/test_location.py b/tests/python/test_location.py index 1a8cd8f..e65eb3e 100644 --- a/tests/python/test_location.py +++ b/tests/python/test_location.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp diff --git a/tests/python/test_position.py b/tests/python/test_position.py index 67bff8b..c149579 100644 --- a/tests/python/test_position.py +++ b/tests/python/test_position.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp diff --git a/tests/python/test_range.py b/tests/python/test_range.py index 9977e95..0a5801b 100644 --- a/tests/python/test_range.py +++ b/tests/python/test_range.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp