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