Skip to content

Commit a31be64

Browse files
committed
🚑 Fix wrong method of UNI
1 parent bb5296a commit a31be64

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ repos:
6969
- mdformat-config
7070
- mdformat-web
7171
- repo: https://github.com/DavidAnson/markdownlint-cli2
72-
rev: v0.18.1
72+
rev: v0.19.0
7373
hooks:
7474
- id: markdownlint-cli2
7575
additional_dependencies:
7676
- markdown-it-texmath
7777
- repo: https://github.com/astral-sh/ruff-pre-commit
78-
rev: v0.14.4
78+
rev: v0.14.5
7979
hooks:
8080
- id: ruff-check
8181
- id: ruff-format

src/tmux_language_server/schema.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
from dataclasses import dataclass
6+
from typing import Self
67

78
from lsp_tree_sitter import UNI
89
from lsp_tree_sitter.schema import Trie
@@ -19,17 +20,17 @@
1920
class TmuxTrie(Trie):
2021
r"""Tmux Trie."""
2122

22-
value: dict[str, "Trie"] | list["Trie"] | str # type: ignore
23+
value: dict[str, Self] | list[Self] | str
2324

2425
@classmethod
25-
def from_node(cls, node: Node, parent: "Trie | None") -> "Trie":
26+
def from_node(cls, node: Node, parent: Self | None) -> Self:
2627
r"""From node.
2728
2829
:param node:
2930
:type node: Node
3031
:param parent:
31-
:type parent: Trie | None
32-
:rtype: "Trie"
32+
:type parent: Self | None
33+
:rtype: Self
3334
"""
3435
if node.type == "value":
3536
return cls(UNI(node).range, parent, UNI(node).text.strip("'\""))

src/tmux_language_server/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def completions(params: CompletionParams) -> CompletionList:
180180
return get_completion_list_by_enum(
181181
text,
182182
get_schema()["properties"]["set-option"]["properties"].get(
183-
uni.node2text(parent.children[-2]), {}
183+
parent.children[-2].text, {}
184184
),
185185
)
186186
return CompletionList(False, [])

0 commit comments

Comments
 (0)