Forge
csharp4405de34
1using CascadeIDE.Contracts;
2using CascadeIDE.Features.Workspace.Application;
3
4namespace CascadeIDE.Features.Search.Application;
5
6/// <summary>Фильтрация файлов решения для префикса <c>f:</c> через <see cref="WorkspaceFileIndex"/>.</summary>
7[PresentationProjection("command palette goto file rows")]
8public static class CommandPaletteGoToFileNavRowsProjection
9{
10 public static IEnumerable<CommandPaletteGoToNavRowPresentation> EnumerateFiltered(
11 WorkspaceFileIndex index,
12 string filterTermTrimmedWhenNonEmptyOrEmptyMeansAll,
13 string workspaceRoot,
14 int maxFiles)
15 {
16 var matches = index.Search(filterTermTrimmedWhenNonEmptyOrEmptyMeansAll, maxFiles);
17 foreach (var m in matches)
18 {
19 var rel = CommandPaletteGoToWorkspacePresentation.TryRelativePath(workspaceRoot, m.FullPath);
20 yield return new CommandPaletteGoToNavRowPresentation(
21 Title: m.Title,
22 SubtitleCategory: rel ?? m.InsertPath,
23 FullPath: m.FullPath,
24 Line: 0,
25 Column: 1,
26 PrefixHint: "f:");
27 }
28 }
29}
30
View only · write via MCP/CIDE