about summary refs log tree commit diff
path: root/src/libsyntax/util/lev_distance.rs
AgeCommit message (Collapse)AuthorLines
2020-02-29Move directory `libsyntax` -> `librustc_ast`Vadim Petrochenkov-107/+0
2020-01-09Rollup merge of #67849 - cjkenn:check-sorted-words, r=estebankYuki Okushi-5/+28
Add a check for swapped words when we can't find an identifier Fixes #66968 Couple things here: 1. The matches take the precedence of case insensitive match, then levenshtein match, then swapped words match. Doing this allows us to not even check for swapped words unless the other checks return `None`. 2. I've assumed that the swapped words check is not held to the limits of the max levenshtein distance threshold (ie. we want to try and find a match even if the levenshtein distance is very high). This means that we cannot perform this check in the `fold` that occurs after the `filter_map` call, because the candidate will be filtered out. So, I've split this into two separate `fold` calls, and had to collect the original iterator into a vec so it can be copied (I don't think we want to change the function signature to take a vec or require the `Copy` trait). An alternative implemenation may be to remove the `filter_map`, `fold` over the entire iterator, and do a check against `max_dist` inside the relevant cases there. r? @estebank
2020-01-03missed tidy checkcjkenn-2/+2
2020-01-03add a check for variable names that might match by wordcjkenn-5/+28
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+3
2019-12-22Format the worldMark Rousskov-28/+28
2019-12-06Use `to_option` in various placesvarkor-1/+1
2019-08-02libsyntax: Unconfigure tests during normal buildVadim Petrochenkov-57/+3
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-2/+2
2019-02-10rustc: doc commentsAlexander Regueiro-2/+2
2019-02-07libsyntax => 2018Taiki Endo-2/+2
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrumkennytm-1/+1
Replace usages of `..i + 1` ranges with `..=i`. Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-1/+1
2018-12-04Fix testShotaro Yamada-1/+2
2018-09-11Add some unit tests for find_best_match_for_namePhilipp Hansch-2/+40
There were only some UI tests that covered this function. Since there's more diagnostic work going on, I think it makes sense to have this unit tested.
2017-12-01move comparator into +find_best_match_name+ functionJulian Kulesh-5/+27
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-3/+4
This is mostly removing stray ampersands, needless returns and lifetimes.
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-6/+5
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-1/+1
2015-12-16Modify the Levenshtein-based suggestions to include importsRavi Shankar-20/+34
2015-11-27Introduce max_suggestion_distance function to avoid duplicating the heuristicFlorian Hartwig-0/+8
2015-11-26Add suggestion of similar macro names to `macro undefined` error messageFlorian Hartwig-0/+63