MonacoQueryInput diagnostics should take pattern type into account
Created by: lguychard
https://github.com/sourcegraph/sourcegraph/pull/7669#issuecomment-573829342:
The comment: there is a general issue with how we parse search patterns based on the search kind being performed (literal, regex, ...). See RFC 75 for the big picture, but as one concrete example, the quoting suggestions or errors (like in your second gif, "Quoting the query might...") doesn't apply to literal search. To figure that out, we need contextual information and to detect 'patterntype'. Another example is that /.../ syntax currently delineates a regex pattern for regex search, but should be treated literally for literal search.
So the parser.ts would also need to parse 'patterntype' to know what pattern is being used (as a hack we use regex for this in the backend, of which I'm not a fan). Once we know patterntype, we'd ideally case out contextually parsing, e.g., /.../. From what I can tell the current parser.tsdoes not take this complexity into account (and there isn't currently a clean solution, which is why I wrote RFC 75). Just putting this on your radar.