-
Notifications
You must be signed in to change notification settings - Fork 45
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
Relace - experimentation #204
Conversation
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.
❌ Changes requested. Reviewed everything up to f8ae29a in 1 minute and 29 seconds
More details
- Looked at
291
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. extensions/vscode/src/util/integrationUtils.ts:74
- Draft comment:
TheextractCodeFromMarkdown
function may not handle multiple code blocks or code blocks without language specification correctly. Consider enhancing the regex to handle these cases. - Reason this comment was not posted:
Confidence changes required:50%
The functionextractCodeFromMarkdown
is used to extract code from markdown text. However, the regex used might not cover all edge cases, such as multiple code blocks or code blocks without language specification.
Workflow ID: wflow_zECIHbCaWkYqOSRO
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
core/util/parameters.ts
Outdated
export const SERVER_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2" | ||
// export const SERVER_URL = "http://localhost:8000"; | ||
// export const SERVER_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2" | ||
export const SERVER_URL = "http://localhost:8000"; |
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.
Consider using an environment variable for SERVER_URL to allow flexibility between development and production environments.
@@ -332,6 +333,74 @@ export class VsCodeMessenger { | |||
verticalDiffManager.streamEdit(prompt, modelTitle); | |||
}); | |||
|
|||
this.onWebview("applyWithRelace", async (msg) => { |
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.
In applyWithRelace
, handle the case where getFastApplyChangesWithRelace
returns the original content due to an error. Notify the user that no changes were made.
): Promise<string> { | ||
try { | ||
const baseHeaders = await getHeaders(); | ||
const auth: any = await vscode.commands.executeCommand("pearai.getPearAuth"); |
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.
Avoid using any
type for auth
. Define a specific type or interface for better type safety.
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.
❌ Changes requested. Incremental review on 4aeb511 in 35 seconds
More details
- Looked at
70
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_NtyzorWOJ1sWCZzF
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
await vscode.commands.executeCommand('workbench.action.revertAndCloseActiveEditor'); | ||
relaceDiffManager.clearDiffState(); | ||
|
||
this.webviewProtocol.request("setRelaceDiffState", {diffVisible: false, originalFileUri: "aasdfasdf", diffFileUri: "asdfasdf"}); |
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.
Avoid using placeholder strings like 'aasdfasdf' and 'asdfasdf'. Use meaningful values for the originalFileUri and diffFileUri in the setRelaceDiffState request.
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.
👍 Looks good to me! Incremental review on 417dd44 in 39 seconds
More details
- Looked at
281
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. gui/src/components/markdown/CodeBlockToolbar.tsx:170
- Draft comment:
TheacceptRelaceDiff
andrejectRelaceDiff
functions are called withundefined
as arguments. Ensure these functions do not rely on parameters that are not being passed, as this could lead to runtime errors. - Reason this comment was not posted:
Comment did not seem useful.
2. core/protocol/ideWebview.ts:22
- Draft comment:
TheacceptRelaceDiff
andrejectRelaceDiff
types still includeoriginalFileUri
anddiffFileUri
parameters, which are no longer used. Consider removing these parameters to align with the updated implementation. - Reason this comment was not posted:
Comment was on unchanged code.
3. extensions/vscode/src/extension/VsCodeMessenger.ts:352
- Draft comment:
Consider showing a user-friendly error message instead of throwing an error whenoriginalContent
is not found. This will improve the user experience. - Reason this comment was not posted:
Confidence changes required:50%
TheapplyWithRelace
function inVsCodeMessenger.ts
has a check fororiginalContent
being empty, but it throws an error instead of showing a user-friendly message. This could be improved for better user experience.
Workflow ID: wflow_eHS2VBtenKRLA6X5
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
❌ Changes requested. Incremental review on f70ebd3 in 47 seconds
More details
- Looked at
210
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. extensions/vscode/src/extension/VsCodeMessenger.ts:727
- Draft comment:
Ensure to handle the case whereverticalDiffManager.createVerticalPerLineDiffHandler
returnsnull
to avoid potential runtime errors. - Reason this comment was not posted:
Comment did not seem useful.
2. extensions/vscode/src/extension/VsCodeMessenger.ts:729
- Draft comment:
Ensure to handle the case whereverticalDiffManager.createVerticalPerLineDiffHandler
returnsnull
to avoid potential runtime errors. - Reason this comment was not posted:
Marked as duplicate.
3. extensions/vscode/src/extension/VsCodeMessenger.ts:681
- Draft comment:
Ensure to handle the case whereverticalDiffManager.createVerticalPerLineDiffHandler
returnsnull
to avoid potential runtime errors. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_ciIBoxaYqbvVABau
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
yield { type: 'new', line: modDiff[diffJ++] }; | ||
} else if (diffJ >= modDiff.length) { | ||
// Add CodeLens for deleted line | ||
vscode.languages.registerCodeLensProvider({ scheme: 'file' }, { |
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.
Registering a CodeLens provider inside the generator function for each deleted line is inefficient. Consider moving this logic outside the generator to avoid performance issues.
this is a good pr to refer to for relace and diff stuff. |
closing this pr, we now have relace, but this is a good pr to refer to for relace and diff stuff.
Important
Adds 'Fast Apply' feature using Relace service for quick code changes with UI and backend integration.
applyWithRelace
,applyWithRelaceHorizontal
,applyWithRelaceVertical
,acceptRelaceDiff
, andrejectRelaceDiff
toToIdeFromWebviewProtocol
inideWebview.ts
.VsCodeMessenger
to manage code changes and diffs.getFastApplyChangesWithRelace
inrelace.ts
to fetch modified content from a server.CodeBlockToolBar
inCodeBlockToolbar.tsx
for horizontal and vertical application of changes.extractCodeFromMarkdown
tointegrationUtils.ts
to extract code from markdown text.RelaceDiffManager
inrelaceDiffManager.ts
to manage diff states.SERVER_URL
inparameters.ts
to use a local development URL.This description was created by
for f70ebd3. It will automatically update as commits are pushed.