trypear / pearai-app

An Open Sourced AI-Powered Text Editor. A fork of VSCode and Continue.
https://trypear.ai
Other
561 stars 90 forks source link

[Hard][App] Update Inline chat prompting location #36

Open Fryingpannn opened 1 month ago

Fryingpannn commented 1 month ago

In-line chat prompt should be right where the code is, instead of on top of editor.

Currently:

image

Should be:

image image
Himanshu-Singh-Chauhan commented 2 weeks ago

the inline chat is shown using QuickPick provided by vscode, code

it does not have option to change location or position, it always shows up top. copilot and cursor might be using something custom to show inline prompts. https://github.com/microsoft/vscode/issues/17268

found this also - don't know if it's useful - https://stackoverflow.com/questions/77202394/what-vs-code-api-can-i-use-to-create-an-in-editor-chat-box-like-in-github-copilo chatparticipants api - https://github.com/microsoft/vscode/issues/199908

Fryingpannn commented 2 weeks ago

Conversation context from Discord:

Mex:

"I think I should mention my progress on the inline chat. So after a few hours of trial and error I really believe that is impossible to do it within the pearai-submodule (that's where every other command is), the reason being that vscode api doesn't offer support for inline stuff. I think this is actually the reason continue doesn't have this on vscode (because it's an extension and they can't edit the source code of core vsc) and maybe the reason cursor is closed sourced. I tried simulating the effect with the available tools (like webview api and decorators) but 0 success and it's buggy as hell. The only question is how does Github Copilot do it, because that is an extension. I think vscode offered some exclusive support to them since they're both microsoft or something, otherwise I can't explain. Imo the way to do it is to create some api support for inline chat in the vscode core app, and then in the submodule just work with it. This creates the most consistency with our code base for now. What do y'all think?"

Pan:

"Interesting thank you for the update! That makes sense, we would have to make changes within the actual pearai-app codebase, not just the submodule to make this work. We should try to do that Do you think you'd be able to explore it further by making changes within the entire repo? I think it may be similar idea to the chat panel. E.g. the chat panel is from the outer codebase, and extensions simply display their webviews within the existing chat panel May need something similar Some inline component from outer code, and from there make calls to the backend server"