forked from Kilo-Org/kilocode
-
Notifications
You must be signed in to change notification settings - Fork 1
[pull] main from Kilo-Org:main #311
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…triggering Implements intelligent autocomplete skip logic to reduce unnecessary LLM requests and improve user experience by avoiding autocomplete in inappropriate contexts. Key features: - Language-aware statement terminator detection (supports 10+ language families) - Skip autocomplete at end of complete statements (after ;, }, ), etc.) - Skip during mid-word typing (for words longer than 2 characters) - Comprehensive test coverage with 313 test cases - Centralized configuration for easy language support expansion Changes: - Add contextualSkip.ts module with shouldSkipAutocomplete() entry point - Integrate skip logic into GhostInlineCompletionProvider - Add extensive test suite covering edge cases and language-specific behavior Supported languages: JavaScript/TypeScript, Python, Ruby, Go, Rust, Shell, SQL, Lisp family, C-like languages, and markup languages.
…contextualSkip - Removed the /\s$/.test(beforeTerminator) condition from multi-character terminator matching - Multi-character terminators (fi, done, end) now only match at the start of a line - Updated tests to reflect the new behavior - All 49 tests passing
- Removed entire multi-character terminator checking logic (lines 175-183) - Multi-character terminators like 'fi', 'done', 'end' are no longer checked - Only single-character terminators (;, }, )) are now validated - Updated tests to reflect new behavior - All 49 tests passing
- Changed isMidWordTyping return type from object to boolean - Moved wordLength > 2 logic inside isMidWordTyping function - Simplified shouldSkipAutocomplete to directly use boolean result - All 49 tests passing
If wordLength >= 1, the regex match guarantees the last char is a word character, making the separate check redundant.
Combine the firstCharAfter extraction and regex test into a single expression using short-circuit evaluation.
- Remove redundant family name field and intermediate lookup map - Keep family grouping in LANGUAGE_CONFIGS to avoid duplication - Build LANGUAGE_TERMINATORS directly from configs for O(1) lookup - Remove redundant fallback in isAtEndOfStatement (handled in getTerminatorsForLanguage) - Add proper multi-character terminator support using endsWith() - Fix shell test to correctly expect 'fi' to skip (it's a terminator) Addresses review comments from @EamonNerbonne
Move cache lookup before shouldSkipAutocomplete() check so that partial typing matches from cache are still returned. The contextual skip logic now only blocks new LLM requests during mid-word typing, not cached suggestions.
Co-authored-by: Eamon Nerbonne <[email protected]>
…racter Change isMidWordTyping logic from AND to OR condition so that autocomplete is skipped when either the prefix ends with a long word OR the suffix starts with a word character. This prevents unwanted completions when cursor is positioned before existing code.
…lete feat(autocomplete): add contextual skip logic for smart autocomplete triggering
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )