Repository navigation
Conversation
Whether an inline suggestion runs over several lines is decided by twinny.multilineCompletionsEnabled and a guess from the code round the cursor. Users who usually want one line, and a block only now and then (or the other way round), had no way to ask for the other length at the moment they wanted it (twinnydotdev#201). Two commands now trigger a suggestion at the cursor with the length chosen by the user, whatever the setting and the guess would pick: - "Twinny - Suggest one line" (twinny.suggestLine) - "Twinny - Suggest several lines" (twinny.suggestLines), up to twinny.maxLines They have no default keys, so nothing clashes with Alt+\ or other extensions; they can be bound in Keyboard Shortcuts and show in the command palette while an editable editor has focus. The command records the length with the document, version and cursor it was asked at, then runs editor.action.inlineSuggest.trigger. The first invoked request takes it, and uses it only if it is for that same place, so the next suggestion follows the settings again. A request with an asked length is never served from the suggestion on screen or the one prefetched for the next line, since either may be the other length, and it is cached under its own key. Typing through a suggestion the command showed still serves the rest of it. The settings' descriptions mention the commands. Tests drive the command through the editor with the provider registered against a fake Ollama: several lines where the settings give one, one line where they give a block, and the asked length being let go once a request elsewhere takes it. The prefetch tests' helpers move up a level so the new suite can share them.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Merged
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.
Closes #201
Whether an inline suggestion is one line or several is decided by
twinny.multilineCompletionsEnabledand a guess from the code round the cursor. If you usually want one line and a block only now and then (or the other way round), there was no way to ask for the other length when you wanted it.twinny.suggestLine)twinny.suggestLines), up totwinny.maxLinesmultilineCompletionsEnabledandmaxLinesmention them.editor.action.inlineSuggest.trigger. The first invoked request uses that length, and only if it was made at that same place. The saved length is cleared either way, so the next suggestion follows the settings again.completion-lifecycle.test.ts) run the command through the editor, with the provider registered against a fake Ollama. They cover several lines where the settings give one, one line where the settings give a block, and the saved length being cleared once a request somewhere else uses it. The first two fail without the change. To share the fake Ollama with the new suite, the prefetch suite's helpers move up one level. They are otherwise unchanged apart from acontentparameter.Checked:
tsc,eslint srcand the build are clean. The new tests and the commands test pass. In the fullnpm testrun, 876 tests passed, and 5Chat edit_file/Agent replytests failed in my headless Linux container. Those 5 fail the same way onmainwithout this change.npm run test:sqlitepasses.