We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caed836 commit b7ab079Copy full SHA for b7ab079
crates/ra_ide/src/extend_selection.rs
@@ -139,9 +139,10 @@ fn extend_tokens_from_range(
139
})
140
.collect();
141
142
- // Compute the first and last token index in original_range
143
- let first_idx = *indices.iter().min_by_key(|&&idx| all_tokens[idx].text_range().start())?;
144
- let last_idx = *indices.iter().max_by_key(|&&idx| all_tokens[idx].text_range().end())?;
+ // The first and last token index in original_range
+ // Note that the indices is sorted
+ let first_idx = *indices.first()?;
145
+ let last_idx = *indices.last()?;
146
147
// compute original mapped token range
148
let expanded = {
0 commit comments