Skip to content
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

Allow filerting backticks in AI code completion #14777

Merged
merged 2 commits into from
Jan 29, 2025
Merged

Conversation

JonasHelming
Copy link
Contributor

fixed #14461

What it does

  • Add a new prompt variant "-next" to code completion agents
  • Add a settings to filter backticks from code completion

How to test

Use the next variant for code completion (report if it performs better)
Check that backticks are removed (compare with history view where backicks are not removed)

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

if (text.startsWith('```')) {
// Remove the first backticks and any language identifier
const startRemoved = text.slice(3).replace(/^\w*\n/, '');
const secondBacktickIndex = startRemoved.indexOf('```');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use lastIndexOf ?
This would better catch this case:
```\nFoo```Bar```FooBar```
I would expect the result to be: Foo```Bar```FooBar
but in your code I assume it would be: Foo

Copy link
Contributor

@eneufeld eneufeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works well.
I left a remark about the algorithm though

Signed-off-by: Jonas Helming <[email protected]>
@JonasHelming JonasHelming requested a review from eneufeld January 29, 2025 10:42
Copy link
Contributor

@eneufeld eneufeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@JonasHelming JonasHelming merged commit d9a6525 into master Jan 29, 2025
11 checks passed
@github-actions github-actions bot added this to the 1.58.0 milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Theia AI] Setting to automatically remove backticks from LLM response
3 participants