code monitors: respect default pattern type#63333
Conversation
| <ValidQueryChecklistItem | ||
| checked={hasValidPatternTypeFilter} | ||
| hint="Code monitors support literal and regex search. Searches are literal by default." | ||
| hint={`Code monitors support keyword, standard, literal and regex search. The default is ${defaultPatternType}`} |
There was a problem hiding this comment.
Weird edge case: the user could set their defaultPatternType to structural. Then, hasValidPatternTypeFilter doesn't catch this. This probably never happens and not sure if it's worth fixing :)
There was a problem hiding this comment.
We don't allow setting structural as defaultPatternType, but weirdly enough we allow "lucky" ;-). Will send a PR later
|
Rebased due to merge conflict |
|
I believe I found an issue that is not caused by but is exposed by this PR: https://linear.app/sourcegraph/issue/SRCH-646/repo-and-other-filters-are-not-tokenized-in-query-input-for |
Thanks for reporting. Before this PR we didn't use the keyword chips for highlighting, so the issue was hidden. @fkling any idea what is happening? |
|
I think we need to change the order in which these "chips" and the syntax highlighting is applied (i.e. change the order of the extensions). |
This is part of the Keyword Search GA project (see background below).
The core change is that we use the default pattern type consistently for the query input field and preview. Before, we hardcoded
literalas the default and usedstandardfor previews.This is does not affect existing code monitors.
Other fixes:
Background:
Test Plan:
Co-authored-by: Felix Kling felix@felix-kling.de