Repository navigation
feat(vscode): engine-backed @ file suggestions #3453
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
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
95ca479
feat(vscode): engine-backed @ file suggestions
Grapedge bc9fc76
fix(vscode): keep hover selection from scrolling the mention menus
Grapedge d49cd6a
fix(vscode): cap @ menu items at 50 for the v1 fallback path
Grapedge 3b1c6fe
fix(node-sdk): validate suggestFiles input
Grapedge 391f0cc
chore: collapse the sdk suggestFiles changeset into one sentence
Grapedge a225203
fix(vscode): ignore @ menu confirmation while suggestions are stale
Grapedge e382f3a
fix(vscode): guard stale @ menu mouse selection
Grapedge 8e96a0e
fix(vscode): quote @ mentions whose paths contain spaces
Grapedge 94b68c4
fix(vscode): keep surrogate pairs intact when highlighting mentions
Grapedge e4999dc
fix(vscode): satisfy lint in the surrogate-pair guard
Grapedge 44e170f
fix(vscode): fall through on empty @ results and settle selection on …
Grapedge 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 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code-sdk": minor | ||
| --- | ||
|
|
||
| Add `suggestFiles(workDir, { query, limit })` to `KimiHarness`: session-less fuzzy file suggestions backed by the agent-core-v2 workspace fs service. Returns `undefined` on the v1 engine. | ||
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 @@ | ||
| --- | ||
| "kimi-code": patch | ||
| --- | ||
|
|
||
| Highlight matched characters in @ file suggestions and allow folders to be inserted as mentions. |
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 @@ | ||
| --- | ||
| "kimi-code": patch | ||
| --- | ||
|
|
||
| Show the image/video picker entry in the @ menu only before a search query is typed, and remove the Browse folders mode. |
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 @@ | ||
| --- | ||
| "kimi-code": patch | ||
| --- | ||
|
|
||
| Fix the @ and / suggestion lists jittering when the mouse rests at the scroll edge. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { mentionMatchSpans } from '@/lib/mention-match'; | ||
|
|
||
| describe('mentionMatchSpans', () => { | ||
| it('returns the whole text as a plain span when positions are missing or empty', () => { | ||
| expect(mentionMatchSpans('app.ts', undefined, 0)).toEqual([{ text: 'app.ts', hit: false }]); | ||
| expect(mentionMatchSpans('app.ts', [], 0)).toEqual([{ text: 'app.ts', hit: false }]); | ||
| expect(mentionMatchSpans('', [0], 0)).toEqual([{ text: '', hit: false }]); | ||
| }); | ||
|
|
||
| it('splits hit and plain runs by position', () => { | ||
| expect(mentionMatchSpans('app.ts', [0, 1, 4], 0)).toEqual([ | ||
| { text: 'ap', hit: true }, | ||
| { text: 'p.', hit: false }, | ||
| { text: 't', hit: true }, | ||
| { text: 's', hit: false }, | ||
| ]); | ||
| }); | ||
|
|
||
| it('shifts path-frame positions into the name frame via start', () => { | ||
| // path 'src/app.ts' (len 10), name 'app.ts' → start = 6 | ||
| expect(mentionMatchSpans('app.ts', [6, 7, 10], 6)).toEqual([ | ||
| { text: 'ap', hit: true }, | ||
| { text: 'p.', hit: false }, | ||
| { text: 't', hit: true }, | ||
| { text: 's', hit: false }, | ||
| ]); | ||
| }); | ||
|
|
||
| it('drops positions outside the text frame', () => { | ||
| expect(mentionMatchSpans('app.ts', [0, 1, 2], 6)).toEqual([{ text: 'app.ts', hit: false }]); | ||
| expect(mentionMatchSpans('src', [0, 6, 7], 0)).toEqual([ | ||
| { text: 's', hit: true }, | ||
| { text: 'rc', hit: false }, | ||
| ]); | ||
| }); | ||
|
|
||
| it('handles adjacent hits as a single run', () => { | ||
| expect(mentionMatchSpans('abc', [0, 1, 2], 0)).toEqual([{ text: 'abc', hit: true }]); | ||
| }); | ||
| }); |
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.