Repository navigation
fix(completion): protect astral Unicode caret and identifier boundaries - #177
Merged
Merged
Conversation
… and overlap cleanup
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
User-visible issue
VS Code cursor columns are UTF-16 code-unit offsets, so a manual or automatic inline completion can be requested at a position between the halves of an emoji or non-BMP letter. Although context extraction trims orphaned halves from prompts, inserting completion text at that cursor could split the actual editor character. Separately, prefix-echo and suffix-overlap filtering treated surrogate halves as non-identifier punctuation and could truncate genuine non-BMP identifiers.
Implementation
isSafeInsertionBoundarycheck: only valid UTF-16 line offsets outside surrogate pairs are eligible. Apply before any context collection, Ollama request, or manual/automatic response path.docs/qa/unicode-inline-boundary-acceptance.md, explicitly NOT RUN.Gates and limitations
Full cross-platform CI, unit tests, Linux mocked editor-host integration, security audit and isolated VSIX candidate installation/upgrade must succeed before merge. There are no new network calls, model downloads, trained weights, repository indexes, publisher-ID changes, GitHub releases or registry publications. Physical editor and real Ollama model performance remain unverified.