mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Always Show File Names in Symbol Search Results (#26518)
* Fixes #26370 Updates the symbol search results to always display the filename. This feature was previously added to the TS extension specifically, so this change removes that work in favor of a change to the core symbol search experience * Use dash with filename
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
|
||||
import { workspace, window, Uri, WorkspaceSymbolProvider, SymbolInformation, SymbolKind, Range, Location, CancellationToken } from 'vscode';
|
||||
|
||||
import * as path from 'path';
|
||||
|
||||
import * as Proto from '../protocol';
|
||||
import { ITypescriptServiceClient } from '../typescriptService';
|
||||
|
||||
@@ -76,17 +74,8 @@ export default class TypeScriptWorkspaceSymbolProvider implements WorkspaceSymbo
|
||||
if (item.kind === 'method' || item.kind === 'function') {
|
||||
label += '()';
|
||||
}
|
||||
const containerNameParts: string[] = [];
|
||||
if (item.containerName) {
|
||||
containerNameParts.push(item.containerName);
|
||||
}
|
||||
const fileUri = this.client.asUrl(item.file);
|
||||
const fileName = path.basename(fileUri.fsPath);
|
||||
if (fileName) {
|
||||
containerNameParts.push(fileName);
|
||||
}
|
||||
result.push(new SymbolInformation(label, getSymbolKind(item), containerNameParts.join(' — '),
|
||||
new Location(fileUri, range)));
|
||||
result.push(new SymbolInformation(label, getSymbolKind(item), item.containerName || '',
|
||||
new Location(this.client.asUrl(item.file), range)));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user