Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/vs/workbench/contrib/search/browser/media/searchview.css
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@
font-weight: 500;
}

.search-view .textsearchresult .monaco-icon-label .codicon {
position: relative;
font-size: 12px;
top: 1px;
padding-right: 3px;
}

.pane-body:not(.wide) .search-view .foldermatch .monaco-icon-label,
.pane-body:not(.wide) .search-view .filematch .monaco-icon-label {
flex: 1;
Expand Down
10 changes: 7 additions & 3 deletions src/vs/workbench/contrib/search/browser/searchResultsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { defaultCountBadgeStyles } from '../../../../platform/theme/browser/defa
import { SearchContext } from '../common/constants.js';
import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js';
import { IHoverService } from '../../../../platform/hover/browser/hover.js';
import { Codicon } from '../../../../base/common/codicons.js';
import { ISearchTreeMatch, isSearchTreeMatch, RenderableMatch, ITextSearchHeading, ISearchTreeFolderMatch, ISearchTreeFileMatch, isSearchTreeFileMatch, isSearchTreeFolderMatch, isTextSearchHeading, ISearchModel, isSearchTreeFolderMatchWorkspaceRoot, isSearchTreeFolderMatchNoRoot } from './searchTreeModel/searchTreeCommon.js';
import { isSearchTreeAIFileMatch } from './AISearch/aiSearchModelBase.js';

Expand Down Expand Up @@ -111,18 +112,21 @@ export class TextSearchResultRenderer extends Disposable implements ICompressibl
renderTemplate(container: HTMLElement): ITextSearchResultTemplate {
const disposables = new DisposableStore();
const textSearchResultElement = DOM.append(container, DOM.$('.textsearchresult'));
const label = this.labels.create(textSearchResultElement, { supportDescriptionHighlights: true, supportHighlights: true });
const label = this.labels.create(textSearchResultElement, { supportDescriptionHighlights: true, supportHighlights: true, supportIcons: true });
disposables.add(label);
return { label, disposables };
}

async renderElement(node: ITreeNode<ITextSearchHeading, any>, index: number, templateData: IFolderMatchTemplate, height: number | undefined): Promise<void> {
if (node.element.isAIContributed) {
const aiName = await node.element.parent().searchModel.getAITextResultProviderName();
templateData.label.setLabel(nls.localize({
const localizedLabel = nls.localize({
key: 'searchFolderMatch.aiText.label',
comment: ['This is displayed before the AI text search results, where {0} will be in the place of the AI name (ie: Copilot)']
}, '{0} Results', aiName));
}, '{0} Results', aiName);

// todo: make icon extension-contributed.
templateData.label.setLabel(`$(${Codicon.copilot.id}) ${localizedLabel}`);
} else {
templateData.label.setLabel(nls.localize('searchFolderMatch.plainText.label', "Text Results"));
}
Expand Down