2727 Hover ,
2828 MarkupContent ,
2929 MarkupKind ,
30+ PublishDiagnosticsParams ,
3031 TextDocumentPositionParams ,
3132 TextEdit ,
3233)
@@ -72,7 +73,9 @@ def did_change(params: DidChangeTextDocumentParams) -> None:
7273 filetype = get_filetype (params .text_document .uri )
7374 if filetype == "" :
7475 return None
75- document = self .workspace .get_document (params .text_document .uri )
76+ document = self .workspace .get_text_document (
77+ params .text_document .uri
78+ )
7679 self .trees [document .uri ] = parser .parse (document .source .encode ())
7780 diagnostics = get_diagnostics (
7881 document .uri ,
@@ -84,7 +87,12 @@ def did_change(params: DidChangeTextDocumentParams) -> None:
8487 from .tools .namcap import namcap
8588
8689 diagnostics += namcap (document .path , document .source )
87- self .publish_diagnostics (params .text_document .uri , diagnostics )
90+ self .text_document_publish_diagnostics (
91+ PublishDiagnosticsParams (
92+ params .text_document .uri ,
93+ diagnostics ,
94+ )
95+ )
8896
8997 # https://github.com/termux/termux-language-server/issues/19#issuecomment-2413779969
9098 # @self.feature(TEXT_DOCUMENT_FORMATTING)
@@ -98,7 +106,9 @@ def format(params: DocumentFormattingParams) -> list[TextEdit]:
98106 filetype = get_filetype (params .text_document .uri )
99107 if filetype == "" :
100108 return []
101- document = self .workspace .get_document (params .text_document .uri )
109+ document = self .workspace .get_text_document (
110+ params .text_document .uri
111+ )
102112 return get_text_edits (
103113 document .uri ,
104114 self .trees [document .uri ],
@@ -117,7 +127,9 @@ def document_link(params: DocumentLinkParams) -> list[DocumentLink]:
117127 filetype = get_filetype (params .text_document .uri )
118128 if filetype == "" :
119129 return []
120- document = self .workspace .get_document (params .text_document .uri )
130+ document = self .workspace .get_text_document (
131+ params .text_document .uri
132+ )
121133 if filetype in {"build.sh" , "subpackage.sh" }:
122134 return CSVFinder (filetype ).get_document_links (
123135 document .uri ,
@@ -154,7 +166,9 @@ def hover(params: TextDocumentPositionParams) -> Hover | None:
154166 filetype = get_filetype (params .text_document .uri )
155167 if filetype == "" :
156168 return None
157- document = self .workspace .get_document (params .text_document .uri )
169+ document = self .workspace .get_text_document (
170+ params .text_document .uri
171+ )
158172 uni = PositionFinder (params .position ).find (
159173 document .uri , self .trees [document .uri ]
160174 )
@@ -219,7 +233,9 @@ def completions(params: CompletionParams) -> CompletionList:
219233 filetype = get_filetype (params .text_document .uri )
220234 if filetype == "" :
221235 return CompletionList (False , [])
222- document = self .workspace .get_document (params .text_document .uri )
236+ document = self .workspace .get_text_document (
237+ params .text_document .uri
238+ )
223239 uni = PositionFinder (params .position , right_equal = True ).find (
224240 document .uri , self .trees [document .uri ]
225241 )
0 commit comments