Skip to content

Disable search and replace if results are incompatible with `replace` command

Created by: courier-new

Search and replace only makes sense for file matches, and the replace command will ignore all other types of results. That means if a user runs a search query with type:<anything except file/path>, or if there aren't any path-type results, search and replace is not going to return any results. (Open question: are there other conditions that might make a query be incompatible with search-and-replace, too?)

  • If we can detect that search-and-replace isn't going to work (e.g. if the search query has type:<not file/path>), we should disable search-and-replace
  • If we can't detect it, but there just aren't any results from the streaming endpoint when you add the replace.diff(...) command, we should show a useful alert about search-and-replace being limited to file/path matches

This will require a bit of design work.