Skip to content

Allow specifying max lines used for AI code completion context#14539

Merged
JonasHelming merged 3 commits intomasterfrom
GH-14538
Nov 28, 2024
Merged

Allow specifying max lines used for AI code completion context#14539
JonasHelming merged 3 commits intomasterfrom
GH-14538

Conversation

@JonasHelming
Copy link
Copy Markdown
Contributor

Review #14537 first, please

What it does

Adds a new user setting allowing to specify max lines used for AI code completion context

How to test

  • Change the setting to other values than 0
  • Open the AI History View => Code Completion
  • Trigger code completion (SHIFT+SPACE) and check the context

Follow-ups

This could be more sophisticated, e.g. with percentages for prefix and suffix or by respecting the AST.

Review checklist

Reminder for reviewers

Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

The change looks good to me and works as expected. Thank you very much, Jonas! However, I do have some questions regarding the setting as a whole that I'd like to clarify before we merge this.

Comment thread packages/ai-code-completion/src/browser/ai-code-completion-preference.ts Outdated
Comment thread packages/ai-code-completion/src/browser/ai-code-completion-preference.ts Outdated
fixed #14538

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Make suffix calculation robust against beeing at line 0

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

I had another look and everything works really nicely! Thank you very much for the quick turnaround!

@JonasHelming JonasHelming merged commit 8ad410c into master Nov 28, 2024
@github-actions github-actions Bot added this to the 1.56.0 milestone Nov 28, 2024
@ndoschek ndoschek deleted the GH-14538 branch December 5, 2025 15:32
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.

2 participants