Skip to content

Commit 31502bc

Browse files
authored
fix(amazonq): remove parentDispoable for realTimeListener add (#5813)
1. listener will be completed managed by fileOpen/fileClose, otherwise killing Amazon Q Context process will dispose TextDocumentServiceHandler which will remove this listener before fileClose and logs an error during fileClose
1 parent 9e4d910 commit 31502bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/textdocument/TextDocumentServiceHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ class TextDocumentServiceHandler(
7171
realTimeEdit(event)
7272
}
7373
}
74-
file.putUserData(KEY_REAL_TIME_EDIT_LISTENER, listener)
7574
ApplicationManager.getApplication().runReadAction {
76-
FileDocumentManager.getInstance().getDocument(file)?.addDocumentListener(listener, this)
75+
FileDocumentManager.getInstance().getDocument(file)?.addDocumentListener(listener)
76+
file.putUserData(KEY_REAL_TIME_EDIT_LISTENER, listener)
7777
}
7878
}
7979
AmazonQLspService.executeIfRunning(project) { languageServer ->

0 commit comments

Comments
 (0)