Merge from vscode 6268feb42ba4f2e2fa15484e88c9af60d254998c (#6530)

This commit is contained in:
Anthony Dresser
2019-07-29 21:03:02 -07:00
committed by GitHub
parent 2c8a22bb0d
commit 6db84eefa3
104 changed files with 1797 additions and 3740 deletions

View File

@@ -27,6 +27,7 @@ import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/c
import { URI } from 'vs/base/common/uri';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { CancellationToken } from 'vs/base/common/cancellation';
import { coalesce, flatten } from 'vs/base/common/arrays';
export const defaultReferenceSearchOptions: RequestOptions = {
getMetaTitle(model) {
@@ -287,15 +288,7 @@ export function provideReferences(model: ITextModel, position: Position, token:
});
});
return Promise.all(promises).then(references => {
let result: Location[] = [];
for (let ref of references) {
if (ref) {
result.push(...ref);
}
}
return result;
});
return Promise.all(promises).then(references => flatten(coalesce(references)));
}
registerDefaultLanguageCommand('_executeReferenceProvider', (model, position) => provideReferences(model, position, CancellationToken.None));