1- import uuid
21from dataclasses import dataclass
32from typing import TYPE_CHECKING , Any , Optional
43
109)
1110from ...utils .dataclasses import from_dict
1211from ...utils .logging import LoggingDescriptor
13- from ..common .lsp_types import (
14- DocumentFilter ,
15- InitializeError ,
16- Model ,
17- TextDocumentChangeRegistrationOptions ,
18- TextDocumentRegistrationOptions ,
19- TextDocumentSyncKind ,
20- )
12+ from ..common .lsp_types import InitializeError , Model
2113from ..common .parts .document_symbols import symbol_information_label
2214from ..common .protocol import LanguageServerProtocol
2315from .parts .codelens import RobotCodeLensProtocolPart
@@ -106,7 +98,6 @@ def __init__(self, server: "RobotLanguageServer"):
10698 super ().__init__ (server )
10799 self .options = Options ()
108100 self .on_initialize .add (self ._on_initialize )
109- self .on_initialized .add (self ._on_initialized )
110101 self .on_shutdown .add (self ._on_shutdown )
111102
112103 @_logger .call
@@ -126,30 +117,3 @@ async def _on_initialize(self, sender: Any, initialization_options: Optional[Any
126117 self .options = from_dict (initialization_options , Options )
127118
128119 self ._logger .debug (f"initialized with { repr (self .options )} " )
129-
130- @_logger .call
131- async def _on_initialized (self , sender : Any ) -> None :
132- if (
133- self .client_capabilities
134- and self .client_capabilities .workspace
135- and self .client_capabilities .workspace .file_operations
136- and self .client_capabilities .workspace .file_operations .dynamic_registration
137- ):
138- document_selector = [DocumentFilter (language = "python" )]
139- await self .register_capability (
140- str (uuid .uuid4 ()),
141- "textDocument/didOpen" ,
142- TextDocumentRegistrationOptions (document_selector = document_selector ),
143- )
144- await self .register_capability (
145- str (uuid .uuid4 ()),
146- "textDocument/didChange" ,
147- TextDocumentChangeRegistrationOptions (
148- document_selector = document_selector , sync_kind = TextDocumentSyncKind .INCREMENTAL
149- ),
150- )
151- await self .register_capability (
152- str (uuid .uuid4 ()),
153- "textDocument/didClose" ,
154- TextDocumentRegistrationOptions (document_selector = document_selector ),
155- )
0 commit comments