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

Fix: Prevent autocompletion from triggering incorrectly within words #15030

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eneufeld
Copy link
Contributor

What it does

This commit fixes an issue where autocompletion would incorrectly trigger when typing a variable character '#' in the middle of words (e.g., "Hello#").

Changes:

  • Removed '#' from trigger characters in the variable argument completion provider
  • Improved boundary detection in the variable argument picker to prevent triggering when '#' appears within words
  • Added better context validation to ensure completion only happens in appropriate cases
  • Fixed the implementation to maintain correct functionality for legitimate variable references like "#file:"
  • Refactored code to remove code duplication

The fix ensures that autocompletion is only triggered in intended contexts while preserving all existing functionality. Fixed #15028

How to test

In the chat Input view test different cases:

  • starting with ~, @ or # should trigger the autocompletion
  • continuing after a variable selection via #file with a : should trigger the argument selection
  • typing Foo~, Foo@ or Foo# should not trigger the autocompletion
  • typing Foo ~, Foo @ or Foo # should trigger the autocompletion

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

This commit fixes an issue where autocompletion would incorrectly trigger when typing a variable character '#' in the middle of words (e.g., "Hello#").

Changes:
- Removed '#' from trigger characters in the variable argument completion provider
- Improved boundary detection in the variable argument picker to prevent triggering when '#' appears within words
- Added better context validation to ensure completion only happens in appropriate cases
- Fixed the implementation to maintain correct functionality for legitimate variable references like "#file:"

The fix ensures that autocompletion is only triggered in intended contexts while preserving all existing functionality.
Fixed eclipse-theia#15028
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

[Theia AI] Hashtags always autocomplete in the chat
1 participant