Use flatten array helper

This commit is contained in:
Matt Bierner
2019-04-02 17:16:10 -07:00
parent e50c2572d4
commit 0ec326531e
4 changed files with 12 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ import { isMarkdownFile } from '../util/file';
import { Lazy, lazy } from '../util/lazy';
import MDDocumentSymbolProvider from './documentSymbolProvider';
import { SkinnyTextDocument } from '../tableOfContentsProvider';
import { flatten } from '../util/arrays';
export interface WorkspaceMarkdownDocumentProvider {
getAllMarkdownDocuments(): Thenable<Iterable<SkinnyTextDocument>>;
@@ -108,7 +109,7 @@ export default class MarkdownWorkspaceSymbolProvider extends Disposable implemen
}
const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values()).map(x => x.value));
const allSymbols: vscode.SymbolInformation[] = Array.prototype.concat.apply([], allSymbolsSets);
const allSymbols = flatten(allSymbolsSets);
return allSymbols.filter(symbolInformation => symbolInformation.name.toLowerCase().indexOf(query.toLowerCase()) !== -1);
}