Skip to content

insights: respect the escape sequences provided in the explicit `content` argument of a query

Created by: northyg

  • Sourcegraph version: 3.38
  • Platform information: docker-compose

Steps to reproduce:

  1. Create a new code insight
  2. Give it a query like content: "Color\\(" patterntype:regexp)
  3. The preview displays correctly repo:^(github\.com/sourcegraph/sourcegraph)$ content: "Color\\(")
  4. But on save the Code Insight query becomes content: "Color\(" patterntype:regexp)

Expected behavior:

  1. Code Insight query should not remove the extra regex \ upon saving.

Actual behavior:

  1. The extra \ is removed.
  2. Code Insight doesn't work properly
  3. Work around is to add extra \s to the query.

If would like immediate help on this, please email [email protected] (you can still create the issue, but there are not SLAs on issues like there are for support requests).