Fuzzy finder: allow line number at the end of a filename#55064
Conversation
Previously, it was not possible to navigate straight to a specific line number with the "Files" tab of the fuzzy finder. This commit adds the ability to specify a line number with a `:NUMBER` suffix. This feature makes it possible to copy-paste error messages that use the `FILE:LINE:COLUMN` format and quickly open the location with the fuzzy finder.
vovakulikov
left a comment
There was a problem hiding this comment.
@olafurpg I am still trying to unwrap this, but I think I got your idea about having two transformers for the query and for URL (strip line and column parameters from the actual query but then use it in the URL).
The problem I have is that initially, if you try to type query:line operator in the fuzzy search on the home page, fuzzy search doesn't strip the line operator for actual query for the API call
I don't have a full understanding, but it seems like we can't ignore param argument with transformers in the FuzzyQuery.ts
protected fuzzySearch(): FuzzySearch {
return new CaseInsensitiveFuzzySearch(this.searchValues(), undefined)
}|
@vovakulikov good catch! I only tested it with the repo-local fuzzy finder. I will fix this for the global file finder |
Previously, it only worked with the repo-local finder.
|
@vovakulikov fixed in the latest commit |
vovakulikov
left a comment
There was a problem hiding this comment.
Sorry for the slow response; thanks for the fix, and thanks for the new query operator.
Previously, it was not possible to navigate straight to a specific line number with the "Files" tab of the fuzzy finder. This commit adds the ability to specify a line number with a `:NUMBER` suffix. This feature makes it possible to copy-paste error messages that use the `FILE:LINE:COLUMN` format and quickly open the location with the fuzzy finder. ## Test plan - New storybook test - New unit tests for query parsing <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> (cherry picked from commit 0633c1d)
…me (#55252) Previously, it was not possible to navigate straight to a specific line number with the "Files" tab of the fuzzy finder. This commit adds the ability to specify a line number with a `:NUMBER` suffix. This feature makes it possible to copy-paste error messages that use the `FILE:LINE:COLUMN` format and quickly open the location with the fuzzy finder. ## Test plan - New storybook test - New unit tests for query parsing <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> <br> Backport 0633c1d from #55064 Co-authored-by: Ólafur Páll Geirsson <olafurpg@gmail.com>
Previously, it was not possible to navigate straight to a specific line number with the "Files" tab of the fuzzy finder. This commit adds the ability to specify a line number with a
:NUMBERsuffix. This feature makes it possible to copy-paste error messages that use theFILE:LINE:COLUMNformat and quickly open the location with the fuzzy finder.Test plan