Skip to content

Commit 508c2aa

Browse files
committed
⬆️ Upgrade pygls
1 parent 500a26d commit 508c2aa

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ repos:
6464
- mdformat-myst
6565
- mdformat-toc
6666
- mdformat-deflist
67-
- mdformat-beautysh
67+
# - mdformat-beautysh
6868
- mdformat-ruff
6969
- mdformat-config
7070
- mdformat-web
@@ -75,12 +75,12 @@ repos:
7575
additional_dependencies:
7676
- markdown-it-texmath
7777
- repo: https://github.com/astral-sh/ruff-pre-commit
78-
rev: v0.14.1
78+
rev: v0.14.2
7979
hooks:
8080
- id: ruff-check
8181
- id: ruff-format
8282
- repo: https://github.com/kumaraditya303/mirrors-pyright
83-
rev: v1.1.406
83+
rev: v1.1.407
8484
hooks:
8585
- id: pyright
8686

src/autoconf_language_server/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _cursor_line(self, uri: str, position: Position) -> str:
9494
:type position: Position
9595
:rtype: str
9696
"""
97-
document = self.workspace.get_document(uri)
97+
document = self.workspace.get_text_document(uri)
9898
return document.source.splitlines()[position.line]
9999

100100
def _cursor_word(

src/make_language_server/server.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
MarkupContent,
2525
MarkupKind,
2626
Position,
27+
PublishDiagnosticsParams,
2728
Range,
2829
TextDocumentPositionParams,
2930
)
@@ -61,14 +62,21 @@ def did_change(params: DidChangeTextDocumentParams) -> None:
6162
:type params: DidChangeTextDocumentParams
6263
:rtype: None
6364
"""
64-
document = self.workspace.get_document(params.text_document.uri)
65+
document = self.workspace.get_text_document(
66+
params.text_document.uri
67+
)
6568
self.trees[document.uri] = parser.parse(document.source.encode())
6669
diagnostics = get_diagnostics(
6770
document.uri,
6871
self.trees[document.uri],
6972
DIAGNOSTICS_FINDER_CLASSES,
7073
)
71-
self.publish_diagnostics(params.text_document.uri, diagnostics)
74+
self.text_document_publish_diagnostics(
75+
PublishDiagnosticsParams(
76+
params.text_document.uri,
77+
diagnostics,
78+
)
79+
)
7280

7381
@self.feature(TEXT_DOCUMENT_DEFINITION)
7482
def definition(params: TextDocumentPositionParams) -> list[Location]:
@@ -78,7 +86,9 @@ def definition(params: TextDocumentPositionParams) -> list[Location]:
7886
:type params: TextDocumentPositionParams
7987
:rtype: list[Location]
8088
"""
81-
document = self.workspace.get_document(params.text_document.uri)
89+
document = self.workspace.get_text_document(
90+
params.text_document.uri
91+
)
8292
uni = PositionFinder(params.position).find(
8393
document.uri, self.trees[document.uri]
8494
)
@@ -99,7 +109,9 @@ def references(params: TextDocumentPositionParams) -> list[Location]:
99109
:type params: TextDocumentPositionParams
100110
:rtype: list[Location]
101111
"""
102-
document = self.workspace.get_document(params.text_document.uri)
112+
document = self.workspace.get_text_document(
113+
params.text_document.uri
114+
)
103115
uni = PositionFinder(params.position).find(
104116
document.uri, self.trees[document.uri]
105117
)
@@ -120,7 +132,9 @@ def hover(params: TextDocumentPositionParams) -> Hover | None:
120132
:type params: TextDocumentPositionParams
121133
:rtype: Hover | None
122134
"""
123-
document = self.workspace.get_document(params.text_document.uri)
135+
document = self.workspace.get_text_document(
136+
params.text_document.uri
137+
)
124138
uni = PositionFinder(params.position).find(
125139
document.uri, self.trees[document.uri]
126140
)
@@ -206,7 +220,7 @@ def _cursor_line(self, uri: str, position: Position) -> str:
206220
:type position: Position
207221
:rtype: str
208222
"""
209-
document = self.workspace.get_document(uri)
223+
document = self.workspace.get_text_document(uri)
210224
return document.source.splitlines()[position.line]
211225

212226
def _cursor_word(

0 commit comments

Comments
 (0)