Skip to content

Commit 6fbf46d

Browse files
Replace function by method
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent 027a9db commit 6fbf46d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/languages/src/browser/workspace-symbols.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class WorkspaceSymbolCommand implements QuickOpenModel, CommandContributi
125125

126126
protected createItem(sym: SymbolInformation, provider: WorkspaceSymbolProvider, token: CancellationToken): QuickOpenItem {
127127
const uri = new URI(sym.location.uri);
128-
const icon = toCssClassName(sym.kind) || 'unknown';
128+
const icon = this.toCssClassName(sym.kind) || 'unknown';
129129
let parent = sym.containerName;
130130
if (parent) {
131131
parent += ' - ';
@@ -149,6 +149,14 @@ export class WorkspaceSymbolCommand implements QuickOpenModel, CommandContributi
149149
});
150150
}
151151

152+
protected toCssClassName(symbolKind: SymbolKind, inline?: boolean): string | undefined {
153+
const kind = SymbolKind[symbolKind];
154+
if (!kind) {
155+
return undefined;
156+
}
157+
return `codicon ${inline ? 'inline' : 'block'} codicon-symbol-${kind.toLowerCase() || 'property'}`;
158+
}
159+
152160
private openURL(uri: URI, start: Position, end: Position): void {
153161
this.openerService.getOpener(uri).then(opener => opener.open(uri, {
154162
selection: Range.create(start, end)
@@ -230,11 +238,3 @@ enum SymbolKind {
230238
Operator = 25,
231239
TypeParameter = 26
232240
}
233-
234-
export function toCssClassName(symbolKind: SymbolKind, inline?: boolean): string | undefined {
235-
const kind = SymbolKind[symbolKind];
236-
if (!kind) {
237-
return undefined;
238-
}
239-
return `codicon ${inline ? 'inline' : 'block'} codicon-symbol-${kind.toLowerCase() || 'property'}`;
240-
}

0 commit comments

Comments
 (0)