Skip to content

Commit c18cd51

Browse files
committed
minor fixes and cleanups
1 parent 1b8fdae commit c18cd51

7 files changed

Lines changed: 11 additions & 10 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ generate-lsp-schema:
4242
generate-pyright-schema:
4343
datamodel-codegen \
4444
--input ./assets/lsps/pyright.schema.json \
45-
--output ./lsp_types/python/pyright.py \
45+
--output ./lsp_types/pyright/config_schema.py \
4646
--output-model-type "typing.TypedDict" \
4747
--target-python-version "3.11" \
4848
--input-file-type "jsonschema" \

assets/lsprotocol/lsp.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,8 @@
18981898
]
18991899
},
19001900
"messageDirection": "clientToServer",
1901+
"clientCapability": "textDocument.rangeFormatting",
1902+
"serverCapability": "documentRangeFormattingProvider",
19011903
"params": {
19021904
"kind": "reference",
19031905
"name": "DocumentRangeFormattingParams"
@@ -1928,8 +1930,8 @@
19281930
]
19291931
},
19301932
"messageDirection": "clientToServer",
1931-
"clientCapability": "textDocument.rangeFormatting",
1932-
"serverCapability": "documentRangeFormattingProvider",
1933+
"clientCapability": "textDocument.rangeFormatting.rangesSupport",
1934+
"serverCapability": "documentRangeFormattingProvider.rangesSupport",
19331935
"params": {
19341936
"kind": "reference",
19351937
"name": "DocumentRangesFormattingParams"
@@ -2276,7 +2278,7 @@
22762278
"typeName": "DidOpenTextDocumentNotification",
22772279
"messageDirection": "clientToServer",
22782280
"clientCapability": "textDocument.synchronization",
2279-
"serverCapability": "textDocumentSync",
2281+
"serverCapability": "textDocumentSync.openClose",
22802282
"params": {
22812283
"kind": "reference",
22822284
"name": "DidOpenTextDocumentParams"
@@ -2308,7 +2310,7 @@
23082310
"typeName": "DidCloseTextDocumentNotification",
23092311
"messageDirection": "clientToServer",
23102312
"clientCapability": "textDocument.synchronization",
2311-
"serverCapability": "textDocumentSync",
2313+
"serverCapability": "textDocumentSync.openClose",
23122314
"params": {
23132315
"kind": "reference",
23142316
"name": "DidCloseTextDocumentParams"

assets/scripts/lsp_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: lsp.schema.json
3-
# timestamp: 2025-02-10T04:56:21+00:00
3+
# timestamp: 2025-02-25T17:54:27+00:00
44

55
from __future__ import annotations
66

lsp_types/pyright/config_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: pyright.schema.json
3-
# timestamp: 2025-02-12T06:17:11+00:00
3+
# timestamp: 2025-02-25T17:54:27+00:00
44

55
from __future__ import annotations
66

lsp_types/pyright/session.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import lsp_types
99
from lsp_types.process import LSPProcess, ProcessLaunchInfo
10-
from lsp_types.types import MarkupKind
1110

1211
from .config_schema import Model as PyrightConfig
1312

@@ -54,7 +53,6 @@ async def create(
5453
lsp_types.MarkupKind.Markdown,
5554
lsp_types.MarkupKind.PlainText,
5655
],
57-
# "dynamicRegistration": True,
5856
},
5957
"signatureHelp": {},
6058
}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ exclude_lines = [
5959
"raise ImportError",
6060
"if __name__ == .__main__.:",
6161
"pass",
62+
"\\.\\.\\.",
6263
]
6364

6465

tests/test_pyright/test_pyright_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ async def test_pyright_session_diagnostics():
66
"""Test diagnostic reporting for type errors"""
77
code = """\
88
def greet(name: str) -> str:
9-
return 123
9+
return name + 123
1010
"""
1111

1212
pyright_session = await PyrightSession.create(initial_code=code)

0 commit comments

Comments
 (0)