Skip to content

Commit bb5296a

Browse files
committed
🚑 Fix #7, update lsp-tree-sitter
1 parent 7848e4e commit bb5296a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/tmux_language_server/schema.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ def from_node(cls, node: Node, parent: "Trie | None") -> "Trie":
3232
:rtype: "Trie"
3333
"""
3434
if node.type == "value":
35-
return cls(
36-
UNI.node2range(node), parent, UNI.node2text(node).strip("'\"")
37-
)
35+
return cls(UNI(node).range, parent, UNI(node).text.strip("'\""))
3836
if node.type == "file":
3937
trie = cls(Range(Position(0, 0), Position(1, 0)), parent, {})
4038
for child in node.children:
@@ -46,7 +44,7 @@ def from_node(cls, node: Node, parent: "Trie | None") -> "Trie":
4644
_value: dict[str, Trie] = trie.value # type: ignore
4745
if _type not in _value:
4846
trie.value[_type] = cls( # type: ignore
49-
UNI.node2range(child),
47+
UNI(child).range,
5048
trie,
5149
{} if _type != "source-file" else [],
5250
)
@@ -58,15 +56,15 @@ def from_node(cls, node: Node, parent: "Trie | None") -> "Trie":
5856
# fill subtrie.value
5957
if child.type == "set_option_directive":
6058
value: dict[str, Trie]
61-
value[UNI.node2text(child.children[-2])] = cls.from_node(
59+
value[UNI(child.children[-2]).text] = cls.from_node(
6260
child.children[-1], subtrie
6361
)
6462
elif child.type == "source_file_directive":
6563
value += [ # type: ignore
6664
cls(
67-
UNI.node2range(child.children[1]),
65+
UNI(child.children[1]).range,
6866
subtrie,
69-
UNI.node2text(child.children[1]),
67+
UNI(child.children[1]).text,
7068
)
7169
]
7270
return trie

0 commit comments

Comments
 (0)