3 ms·
> Think css, how much nicer would it be to type "mato" in devtools and get "margin-top"? I can't say that this type of search has ever crossed my mind. This ty
by xyzzy_plugh 3y ago
> Think css, how much nicer would it be to type "mato" in devtools and get "margin-top"?
I can't say that this type of search has ever crossed my mind. This type of search would seem to me to be greatly ambiguous. For example, if you have "tomato" in the corpus then that obviously supercedes "margin-top" for the search string "mato". If you know the entire corpus, then I suppose you can take advantage of shortcuts like this when you know there is only one match, but then again it would seem to me that simply writing "margin-top" would require less mental gymnastics.
- jakear 3y agoIf you've ever used any filtering in VS Code, this is the algorithm. Re tomato/margin-top, weight is given to matching the prefix exactly, so margin-top does indeed rank higher. https://github.com/microsoft/vscode/blob/main/src/vs/base/common/filters.ts#L350 https://github.com/microsoft/vscode/blob/main/src/vs/base/co...