compareAssists static method

int compareAssists(
  1. Assist a,
  2. Assist b
)

Compares two assists by their relevance, then their message.

Implementation

static int compareAssists(Assist a, Assist b) {
  if (a.kind.priority != b.kind.priority) {
    // A higher priority indicates a higher relevance
    // and should be sorted before a lower priority.
    return b.kind.priority - a.kind.priority;
  }
  return a.change.message.compareTo(b.change.message);
}