Skip to content

Commit

Permalink
Update to latest LSP.
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed May 18, 2023
1 parent d4d2438 commit e070e25
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 105 deletions.
2 changes: 2 additions & 0 deletions generator-plugins/python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def _to_snake_case(name: str) -> str:

def _snake_case_item_name(original: str) -> str:
"""Generate snake case names from LSP definition names.
Example:
* PlainText -> PLAIN_TEXT
* $import -> IMPORT
Expand All @@ -123,6 +124,7 @@ def _snake_case_item_name(original: str) -> str:

def _capitalized_item_name(original: str) -> str:
"""Generate capitalized names from LSP definition names.
Example:
* someClass -> SomeClass
* some_class -> SomeClass
Expand Down
22 changes: 11 additions & 11 deletions generator/lsp.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
"kind": "reference",
"name": "FileOperationRegistrationOptions"
},
"documentation": "The will create files request is sent from the client to the server before files are actually\ncreated as long as the creation is triggered from within the client.\n\n@since 3.16.0",
"documentation": "The will create files request is sent from the client to the server before files are actually\ncreated as long as the creation is triggered from within the client.\n\nThe request can return a `WorkspaceEdit` which will be applied to workspace before the\nfiles are created. Hence the `WorkspaceEdit` can not manipulate the content of the file\nto be created.\n\n@since 3.16.0",
"since": "3.16.0"
},
{
Expand Down Expand Up @@ -1633,7 +1633,7 @@
"kind": "reference",
"name": "DocumentFormattingRegistrationOptions"
},
"documentation": "A request to to format a whole document."
"documentation": "A request to format a whole document."
},
{
"method": "textDocument/rangeFormatting",
Expand Down Expand Up @@ -1662,7 +1662,7 @@
"kind": "reference",
"name": "DocumentRangeFormattingRegistrationOptions"
},
"documentation": "A request to to format a range in a document."
"documentation": "A request to format a range in a document."
},
{
"method": "textDocument/onTypeFormatting",
Expand Down Expand Up @@ -3061,7 +3061,7 @@
"kind": "base",
"name": "URI"
},
"documentation": "The document uri to show."
"documentation": "The uri to show."
},
{
"name": "external",
Expand All @@ -3070,7 +3070,7 @@
"name": "boolean"
},
"optional": true,
"documentation": "Indicates to show the resource in an external program.\nTo show for example `https://code.visualstudio.com/`\nin the default WEB browser set `external` to `true`."
"documentation": "Indicates to show the resource in an external program.\nTo show, for example, `https://code.visualstudio.com/`\nin the default WEB browser set `external` to `true`."
},
{
"name": "takeFocus",
Expand All @@ -3091,7 +3091,7 @@
"documentation": "An optional selection range if the document is a text\ndocument. Clients might ignore the property if an\nexternal program is started or the file is not a text\nfile."
}
],
"documentation": "Params to show a document.\n\n@since 3.16.0",
"documentation": "Params to show a resource in the UI.\n\n@since 3.16.0",
"since": "3.16.0"
},
{
Expand Down Expand Up @@ -5682,7 +5682,7 @@
"name": "target",
"type": {
"kind": "base",
"name": "string"
"name": "URI"
},
"optional": true,
"documentation": "The uri this link points to. If missing a resolve request is sent later."
Expand Down Expand Up @@ -6002,7 +6002,7 @@
"documentation": "The edits to apply."
}
],
"documentation": "The parameters passed via a apply workspace edit request."
"documentation": "The parameters passed via an apply workspace edit request."
},
{
"name": "ApplyWorkspaceEditResult",
Expand Down Expand Up @@ -7623,7 +7623,7 @@
"documentation": "Options necessary for the registration."
}
],
"documentation": "General parameters to to register for an notification or to register a provider."
"documentation": "General parameters to register for a notification or to register a provider."
},
{
"name": "Unregistration",
Expand Down Expand Up @@ -13434,7 +13434,7 @@
{
"name": "UTF8",
"value": "utf-8",
"documentation": "Character offsets count UTF-8 code units."
"documentation": "Character offsets count UTF-8 code units (e.g. bytes)."
},
{
"name": "UTF16",
Expand All @@ -13444,7 +13444,7 @@
{
"name": "UTF32",
"value": "utf-32",
"documentation": "Character offsets count UTF-32 code units.\n\nImplementation note: these are the same as Unicode code points,\nso this `PositionEncodingKind` may also be used for an\nencoding-agnostic representation of character offsets."
"documentation": "Character offsets count UTF-32 code units.\n\nImplementation note: these are the same as Unicode codepoints,\nso this `PositionEncodingKind` may also be used for an\nencoding-agnostic representation of character offsets."
}
],
"supportsCustomValues": true,
Expand Down
2 changes: 1 addition & 1 deletion generator/lsp.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@
},
"StructureLiteral": {
"additionalProperties": false,
"description": "Defines a unnamed structure of an object literal.",
"description": "Defines an unnamed structure of an object literal.",
"properties": {
"deprecated": {
"description": "Whether the literal is deprecated or not. If deprecated the property contains the deprecation message.",
Expand Down
6 changes: 4 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,17 @@ def _format_code(session: nox.Session):

session.run("isort", "--profile", "black", ".")
session.run("black", ".")
session.run("docformatter", "--in-place", "--recursive", ".")
session.run("docformatter", "--in-place", "--recursive", "--black", ".")
session.run("isort", "--profile", "black", ".")
session.run("black", ".")

# this is for the lsprotocol package only
python_package_path = "./packages/python/lsprotocol"
session.run("isort", "--profile", "black", python_package_path)
session.run("black", python_package_path)
session.run("docformatter", "--in-place", "--recursive", python_package_path)
session.run(
"docformatter", "--in-place", "--recursive", "--black", python_package_path
)
# do it again to correct any adjustments done by docformatter
session.run("isort", "--profile", "black", python_package_path)
session.run("black", python_package_path)
Expand Down
Loading

0 comments on commit e070e25

Please sign in to comment.