-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: skip ripgrep if workspace is remote #6276
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
Conversation
👷 Deploy request for continuedev pending review.Visit the deploys page to approve it
|
|
✨ No issues found! Your code is sparkling clean! ✨ |
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.
Great work, I'm going to save that dockerfile Gist for easier testing in the future! I've been spinning up an EC2 instance for SSH tests but that was way easier.
This worked for me, I just had a nitpick on some of the logic and then we should be good to merge here.
core/tools/index.ts
Outdated
export const baseToolDefinitions = [...remoteToolDefinitions, grepSearchTool]; | ||
|
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.
I think it would be a little more clear if we inverted the logic here/in the await ide.isWorkspaceRemote()
call. Renaming baseToolDefinitions
to remoteToolDefinitions
forces us to always think in terms of remote or not which is more of an edge case
export const localOnlyToolDefinitions = [grepSearchTool]
export const baseToolDefinitions = [ ... ] // unchanged from before
...
const continueConfig: ContinueConfig = {
slashCommands: [],
tools: [
...((await ide.isWorkspaceRemote())
? baseToolDefinitions
: [...baseToolDefinitions, ...localOnlyToolDefinitions),
],
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.
Also, if it's possible to move the (await ide.isWorkspaceRemote())
ternary into a standalone fn in our core/tools
folder I think that would be nice to keep the logic centralized. I anticipate that it will continue to get more complicated over time.
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.
One other thought 😅 let's throw a link to the upstream issue you opened on the vscode repo in a comment on the localOnlyToolDefinitions
object. Then we can hopefully follow up and remove it in the future.
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.
makes sense. refactored to getToolsForIde
inside core/tools/index.ts
@@ -125,6 +125,10 @@ class IntelliJIDE( | |||
return true | |||
} | |||
|
|||
override suspend fun isWorkspaceRemote(): Boolean { | |||
return this.getIdeInfo().remoteName != "local" |
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.
I didn't now we had remoteName
logic already built out, neat
Hmm another thought, maybe we put your Gist into the |
yes agree. made a few changes and added it as a new script |
Description
When workspace is remote, we want to avoid running ripgrep. This is because ripgrep will run locally instead of running the workspace server.
baseToolDefinitions
excludinggrepSearchTool
IDE
interfaceisWorkspaceRemote
to detect if workspace is remote in vscode and intellijresolves CON-2298
If it is possible to run os remote call from remote installed extension, we should be able to implement grep search for remote ides. corresponding issue in vscode: microsoft/vscode#252269
Checklist
Screenshots
[ For visual changes, include screenshots. Screen recordings are particularly helpful, and appreciated! ]
before.mp4
after.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Replication
You can run a docker container for ssh into a remote host.
You can this dockerfile: https://gist.github.com/uinstinct/314da2b450f5440069bbce5ab14043d2