dedupe workspace symbols results

This commit is contained in:
Johannes Rieken
2021-11-16 14:07:03 +01:00
parent 5c52ca4dac
commit 409041b7ff
9 changed files with 205 additions and 135 deletions

View File

@@ -129,14 +129,8 @@ const newCommands: ApiCommand[] = [
new ApiCommand(
'vscode.executeWorkspaceSymbolProvider', '_executeWorkspaceSymbolProvider', 'Execute all workspace symbol providers.',
[ApiCommandArgument.String.with('query', 'Search string')],
new ApiCommandResult<[search.IWorkspaceSymbolProvider, search.IWorkspaceSymbol[]][], types.SymbolInformation[]>('A promise that resolves to an array of SymbolInformation-instances.', value => {
const result: types.SymbolInformation[] = [];
if (Array.isArray(value)) {
for (let tuple of value) {
result.push(...tuple[1].map(typeConverters.WorkspaceSymbol.to));
}
}
return result;
new ApiCommandResult<search.IWorkspaceSymbol[], types.SymbolInformation[]>('A promise that resolves to an array of SymbolInformation-instances.', value => {
return value.map(typeConverters.WorkspaceSymbol.to);
})
),
// --- call hierarchy