Skip to content

search: Port server side query validation to client side

Created by: fkling

validate.go contains various server side query validations, some of which we can perform in the browser for a better UX. Potential candidates (still need to determine what is feasible):

  • validateRepoRevPair
  • validateCommitParameters
  • validateTypeStructural
  • [ ] validateRepoHasFile (waiting for clarification https://github.com/sourcegraph/sourcegraph/issues/4610#issuecomment-921745222)
  • [ ] validatePureLiteralPattern (don't quite know what this does exactly. might not be possible to evaluate this with tokens alone)
  • [ ] lang: filter contains a known language (caveat: Our client side list might not be up-to-date with the list used on the server) (skipping this one for now)