-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Inline assist seq implementation #1982
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
Closed
catrielmuller
wants to merge
18
commits into
main
from
catrielmuller/inline-assist-seq-implementation
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
610da66
feat: wip improve inline assistant performance
catrielmuller 3fb4a3f
feat: improve search
catrielmuller 61fc748
Update src/services/ghost/GhostStrategy.ts
catrielmuller 8de4678
Update src/services/ghost/GhostStrategy.ts
catrielmuller c6cba99
Update src/services/ghost/GhostProvider.ts
catrielmuller 4a80123
Merge branch 'main' into catrielmuller/inline-assistant-speed-optimiz…
catrielmuller 8784b32
refactor: add changeset
catrielmuller 3f254ce
refactor: improve prompt
catrielmuller 8d25859
refactor: improve prompt for non llama models
catrielmuller e43aaa1
refactor: improve cursor position
catrielmuller 5d65b9c
refactor: select the closest cursor suggestion
catrielmuller 003182e
refactor: divide groups
catrielmuller 737ec2b
refactor: inline assist sequential suggestion
catrielmuller e1d4644
refactor: fix tests
catrielmuller 591ff55
refactor: fix display special characters
catrielmuller 4f78413
refactor: fix display special characters
catrielmuller c5f7253
refactor: improve visual of the popups
catrielmuller a2d72ac
Update .changeset/beige-sheep-post.md
catrielmuller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"kilo-code": minor | ||
--- | ||
|
||
Inline Assist - Model Compatibility and Performance improvements. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import * as vscode from "vscode" | ||
import { GhostSuggestionsState } from "./GhostSuggestions" | ||
|
||
export class GhostCursor { | ||
public moveToAppliedGroup(suggestions: GhostSuggestionsState) { | ||
const editor = vscode.window.activeTextEditor | ||
if (!editor) { | ||
console.log("No active editor found, returning") | ||
return | ||
} | ||
|
||
const documentUri = editor.document.uri | ||
const suggestionsFile = suggestions.getFile(documentUri) | ||
if (!suggestionsFile) { | ||
console.log(`No suggestions found for document: ${documentUri.toString()}`) | ||
return | ||
} | ||
const groups = suggestionsFile.getGroupsOperations() | ||
if (groups.length === 0) { | ||
console.log("No groups to display, returning") | ||
return | ||
} | ||
const selectedGroupIndex = suggestionsFile.getSelectedGroup() | ||
if (selectedGroupIndex === null) { | ||
console.log("No group selected, returning") | ||
return | ||
} | ||
const group = groups[selectedGroupIndex] | ||
const groupType = suggestionsFile.getGroupType(group) | ||
|
||
if (groupType === "/" || groupType === "-") { | ||
const line = Math.min(...group.map((x) => x.oldLine)) | ||
const lineText = editor.document.lineAt(line).text | ||
const lineLength = lineText.length | ||
editor.selection = new vscode.Selection(line, lineLength, line, lineLength) | ||
editor.revealRange( | ||
new vscode.Range(line, lineLength, line, lineLength), | ||
vscode.TextEditorRevealType.InCenter, | ||
) | ||
} else if (groupType === "+") { | ||
const line = Math.min(...group.map((x) => x.oldLine)) + group.length | ||
const lineText = editor.document.lineAt(line).text | ||
const lineLength = lineText.length | ||
editor.selection = new vscode.Selection(line, lineLength, line, lineLength) | ||
editor.revealRange( | ||
new vscode.Range(line, lineLength, line, lineLength), | ||
vscode.TextEditorRevealType.InCenter, | ||
) | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.