Skip to content

Commit 91298e4

Browse files
committed
💩 Disable formatting temporarily
#19 (comment)
1 parent 66db21b commit 91298e4

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exclude: ^templates/|\.json$
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.6.0
6+
rev: v5.0.0
77
hooks:
88
- id: check-added-large-files
99
- id: fix-byte-order-marker
@@ -51,7 +51,7 @@ repos:
5151
exclude_types:
5252
- zsh
5353
- repo: https://github.com/rhysd/actionlint
54-
rev: v1.7.2
54+
rev: v1.7.3
5555
hooks:
5656
- id: actionlint
5757
- repo: https://github.com/adrienverge/yamllint
@@ -83,12 +83,12 @@ repos:
8383
hooks:
8484
- id: shfmt
8585
- repo: https://github.com/astral-sh/ruff-pre-commit
86-
rev: v0.6.7
86+
rev: v0.6.9
8787
hooks:
8888
- id: ruff
8989
- id: ruff-format
9090
- repo: https://github.com/kumaraditya303/mirrors-pyright
91-
rev: v1.1.381
91+
rev: v1.1.383
9292
hooks:
9393
- id: pyright
9494

src/termux_language_server/server.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
TEXT_DOCUMENT_DID_CHANGE,
1515
TEXT_DOCUMENT_DID_OPEN,
1616
TEXT_DOCUMENT_DOCUMENT_LINK,
17-
TEXT_DOCUMENT_FORMATTING,
17+
# TEXT_DOCUMENT_FORMATTING,
1818
TEXT_DOCUMENT_HOVER,
1919
CompletionItem,
2020
CompletionItemKind,
@@ -86,7 +86,8 @@ def did_change(params: DidChangeTextDocumentParams) -> None:
8686
diagnostics += namcap(document.path, document.source)
8787
self.publish_diagnostics(params.text_document.uri, diagnostics)
8888

89-
@self.feature(TEXT_DOCUMENT_FORMATTING)
89+
# https://github.com/termux/termux-language-server/issues/19#issuecomment-2413779969
90+
# @self.feature(TEXT_DOCUMENT_FORMATTING)
9091
def format(params: DocumentFormattingParams) -> list[TextEdit]:
9192
r"""Format.
9293
@@ -177,6 +178,7 @@ def hover(params: TextDocumentPositionParams) -> Hover | None:
177178
if (
178179
parent.type == "array"
179180
and parent.parent is not None
181+
and parent.parent.children[0].text is not None
180182
and parent.parent.children[0].text.decode()
181183
in PACKAGE_VARIABLES.get(filetype, set())
182184
):
@@ -230,6 +232,7 @@ def completions(params: CompletionParams) -> CompletionList:
230232
if (
231233
parent.type == "array"
232234
and parent.parent is not None
235+
and parent.parent.children[0].text is not None
233236
and parent.parent.children[0].text.decode()
234237
in PACKAGE_VARIABLES.get(filetype, set())
235238
):
@@ -250,7 +253,11 @@ def completions(params: CompletionParams) -> CompletionList:
250253
],
251254
)
252255
schema = get_schema(filetype)
253-
if parent.type == "array" and parent.parent is not None:
256+
if (
257+
parent.type == "array"
258+
and parent.parent is not None
259+
and parent.parent.children[0].text is not None
260+
):
254261
property = schema["properties"].get(
255262
parent.parent.children[0].text.decode(), {}
256263
)

0 commit comments

Comments
 (0)