mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 12:15:34 -06:00
use sortAndDeduplicate instead of deduplicate
This commit is contained in:
parent
7fd6868f8b
commit
51616a4043
@ -60,9 +60,8 @@ namespace ts.refactor.convertToNamedParameters {
|
||||
trailingTriviaOption: textChanges.TrailingTriviaOption.Include
|
||||
});
|
||||
|
||||
|
||||
const functionCalls = deduplicate(groupedReferences.functionCalls, equateValues);
|
||||
forEach(functionCalls, call => {
|
||||
const functionCalls = sortAndDeduplicate(groupedReferences.functionCalls, /*comparer*/ (a, b) => compareValues(a.pos, b.pos));
|
||||
for (const call of functionCalls) {
|
||||
if (call.arguments && call.arguments.length) {
|
||||
const newArgument = getSynthesizedDeepClone(createNewArgument(functionDeclaration, call.arguments), /*includeTrivia*/ true);
|
||||
changes.replaceNodeRange(
|
||||
@ -71,7 +70,8 @@ namespace ts.refactor.convertToNamedParameters {
|
||||
last(call.arguments),
|
||||
newArgument,
|
||||
{ leadingTriviaOption: textChanges.LeadingTriviaOption.IncludeAll, trailingTriviaOption: textChanges.TrailingTriviaOption.Include });
|
||||
}});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getGroupedReferences(functionDeclaration: ValidFunctionDeclaration, program: Program, cancellationToken: CancellationToken): GroupedReferences {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user