Skip to content

Allow filerting backticks in AI code completion#14777

Merged
JonasHelming merged 2 commits intomasterfrom
GH-14461-2
Jan 29, 2025
Merged

Allow filerting backticks in AI code completion#14777
JonasHelming merged 2 commits intomasterfrom
GH-14461-2

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

fixed #14461

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
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 <jhelming@eclipsesource.com>
@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
laemmleint pushed a commit to mvtecsoftware/theia that referenced this pull request Aug 18, 2025
* Allow filerting backticks in AI code completion

fixed eclipse-theia#14461

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
@ndoschek ndoschek deleted the GH-14461-2 branch December 5, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

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

3 participants