Skip to content

Commit

Permalink
Use codicons for workspace symbol items
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
  • Loading branch information
RomanNikitenko committed Mar 21, 2020
1 parent d9f2188 commit 050166b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/languages/src/browser/workspace-symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ export class WorkspaceSymbolCommand implements QuickOpenModel, CommandContributi

protected createItem(sym: SymbolInformation, provider: WorkspaceSymbolProvider, token: CancellationToken): QuickOpenItem {
const uri = new URI(sym.location.uri);
const kind = SymbolKind[sym.kind];
const icon = (kind) ? SymbolKind[sym.kind].toLowerCase() : 'unknown';
const icon = toCssClassName(sym.kind) || 'unknown';
let parent = sym.containerName;
if (parent) {
parent += ' - ';
Expand Down Expand Up @@ -231,3 +230,11 @@ enum SymbolKind {
Operator = 25,
TypeParameter = 26
}

export function toCssClassName(symbolKind: SymbolKind, inline?: boolean): string | undefined {

This comment has been minimized.

Copy link
@akosyakov

akosyakov Mar 23, 2020

Member
const kind = SymbolKind[symbolKind];
if (!kind) {
return undefined;
}
return `codicon ${inline ? 'inline' : 'block'} codicon-symbol-${kind.toLowerCase() || 'property'}`;
}

0 comments on commit 050166b

Please sign in to comment.