File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,17 @@ def did_change(ls: LanguageServer, params: types.DidChangeTextDocumentParams) ->
199
199
@self .server .feature (types .TEXT_DOCUMENT_DID_SAVE )
200
200
def did_save (ls : LanguageServer , params : types .DidSaveTextDocumentParams ) -> None :
201
201
uri = URI (params .text_document .uri )
202
+
203
+ # Reload the entire context and create a new LSPContext
204
+ if self .lsp_context is not None :
205
+ try :
206
+ new_context = Context (paths = list (self .lsp_context .context .configs ))
207
+ new_full_context = LSPContext (new_context )
208
+ self .lsp_context = new_full_context
209
+ return
210
+ except Exception as e :
211
+ pass
212
+
202
213
context = self ._context_get_or_load (uri )
203
214
models = context .map [uri .to_path ()]
204
215
if models is None or not isinstance (models , ModelTarget ):
You can’t perform that action at this time.
0 commit comments