-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix chat streaming bug #299
Conversation
@@ -148,8 +149,7 @@ private ChatRequestParams addEditorState(final ChatRequestParams chatRequestPara | |||
// only include files that are accessible via lsp which have absolute paths | |||
getOpenFileUri().ifPresent(filePathUri -> { | |||
chatRequestParams.setTextDocument(new TextDocumentIdentifier(filePathUri)); | |||
getSelectionRangeCursorState() | |||
.ifPresent(cursorState -> chatRequestParams.setCursorState(Arrays.asList(cursorState))); | |||
getSelectionRangeCursorState().ifPresent(cursorState -> chatRequestParams.setCursorState(Arrays.asList(cursorState))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert any formatting changes in this PR. That takes away time from reviewing the actual change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, will do. Sorry!
chatUiRequestListener.onSendToChatUi(message); | ||
} | ||
String message = jsonHandler.serialize(command); | ||
chatUiRequestListenerFuture.thenApply(listener -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this approach seems a lil odd IMO although correct. Traditionally listeners in an event subscriber pattern are not intended to be completable futures. In this case, the webview class is the listener to an event. Why do we need to return the listener on L248? Instead can we not make the event handling async i.e make the sendToChatUi call a completable Future insead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address this as part of the larger refactor to the views @taldekar.
Issue #295
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.