Skip to content

Commit ca7368c

Browse files
authored
docs(code-insights): add troubleshooting for old style syntax (#707)
Closes [OSS-23223 ](https://linear.app/sourcegraph/issue/OSS-23223/code-insights-duplicate-back-slashes-in-search-query) ## Pull Request approval Although pull request approval is not enforced for this repository in order to reduce friction, merging without a review will generate a ticket for the docs team to review your changes. So if possible, have your pull request approved before merging.
1 parent 6ece1d7 commit ca7368c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/code_insights/how-tos/Troubleshooting.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,39 @@ Known issues:
107107
- Note: this only completes the failing org jobs. You may then see the `user not found` error above, and will still need to mark the rest of the jobs as complete.
108108

109109
3. If the error messages are neither of those two things, this is not currently a known issue. Contact support and we can help!
110+
111+
## Clicking on Code Insight data points leads to invalid search queries
112+
113+
### Issue
114+
When clicking on a data point in a Code Insight, users are redirected to the search results page with an invalid search query,
115+
resulting in no results or an error message.
116+
117+
### Symptoms
118+
- Clicking on a Code Insight data point leads to a search query with too many slashes
119+
- The search query fails with an error message like: "Unable To Process Query Error parsing regexp: missing closing ): (/"
120+
- No search results are displayed
121+
122+
### Workaround
123+
124+
Modify your Code Insight query to use the new syntax style. For example:
125+
126+
Instead of:
127+
128+
```
129+
select:file patterntype:regexp file:.php content:class\s(.)\sextends\sModelRepo\s{
130+
```
131+
132+
Use:
133+
134+
```
135+
select:file file:.php /class\s(.)\sextends\sModelRepo\s{/
136+
```
137+
138+
### Steps to apply the workaround
139+
140+
1. Navigate to your Code Insight
141+
2. Locate the query causing the issue
142+
3. Update the query using the new syntax style as shown above
143+
4. Save the changes to your Code Insight
144+
145+
After applying this workaround, clicking on data points should lead to valid search queries and display the expected results.

0 commit comments

Comments
 (0)