1
- import uuid
2
1
from dataclasses import dataclass
3
2
from typing import TYPE_CHECKING , Any , Optional
4
3
10
9
)
11
10
from ...utils .dataclasses import from_dict
12
11
from ...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
21
13
from ..common .parts .document_symbols import symbol_information_label
22
14
from ..common .protocol import LanguageServerProtocol
23
15
from .parts .codelens import RobotCodeLensProtocolPart
@@ -106,7 +98,6 @@ def __init__(self, server: "RobotLanguageServer"):
106
98
super ().__init__ (server )
107
99
self .options = Options ()
108
100
self .on_initialize .add (self ._on_initialize )
109
- self .on_initialized .add (self ._on_initialized )
110
101
self .on_shutdown .add (self ._on_shutdown )
111
102
112
103
@_logger .call
@@ -126,30 +117,3 @@ async def _on_initialize(self, sender: Any, initialization_options: Optional[Any
126
117
self .options = from_dict (initialization_options , Options )
127
118
128
119
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