chore: generate
This commit is contained in:
@@ -133,10 +133,7 @@ function item(hit: Fff.Hit): Item {
|
||||
}
|
||||
}
|
||||
|
||||
function collectPaths<T>(
|
||||
items: T[],
|
||||
toPath: (item: T) => string,
|
||||
): string[] {
|
||||
function collectPaths<T>(items: T[], toPath: (item: T) => string): string[] {
|
||||
return Array.from(
|
||||
new Set(
|
||||
items.flatMap((item): string[] => {
|
||||
|
||||
@@ -367,8 +367,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
||||
|
||||
const next = extractLineRange(value)
|
||||
const list = await input.findFiles(next.base)
|
||||
return list
|
||||
.map((item): Auto => {
|
||||
return list.map((item): Auto => {
|
||||
const url = pathToFileURL(path.resolve(input.directory, item))
|
||||
let filename = item
|
||||
if (next.line && !item.endsWith("/")) {
|
||||
@@ -462,13 +461,9 @@ export function createPromptState(input: PromptInput): PromptState {
|
||||
const next = removeLineRange(query())
|
||||
if (mode() === "mention") {
|
||||
return [
|
||||
...fuzzysort
|
||||
.go(next, agents(), { keys: ["value", "display", "description"] })
|
||||
.map((item) => item.obj),
|
||||
...fuzzysort.go(next, agents(), { keys: ["value", "display", "description"] }).map((item) => item.obj),
|
||||
...files(),
|
||||
...fuzzysort
|
||||
.go(next, resources(), { keys: ["value", "display", "description"] })
|
||||
.map((item) => item.obj),
|
||||
...fuzzysort.go(next, resources(), { keys: ["value", "display", "description"] }).map((item) => item.obj),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user