Closed wwayne closed 2 hours ago
I think it is not always good to explicitly display the selection code in the user message.
It could be that if the user asks a question with 'this/that'. But it appears to be confusing if the user asks a generic question with some text selected.
@icycodes I started the discussion on slack
Main feature
When code is selected in the editor, the chat panel can send a message containing the selected code to the server
If no code is selected, the chat panel will not include additional information
Implementation
/chat
page has a new query parameterhandle-message-submit
. Whenhandle-message-submit=true
,/chat
page delegates the handling of the submitted message to its parent container (e.g., VSCode).onSubmitMessage
is called, it attempts to fetch the selected code snippets./chat
endpoint to process the new message, including the selected code as relavantContext, and inside the /chat, it will take relavantContext as code_query.