The following search string when Parsed then returned to a string with StringHuman and Parsed again is producing different results. This was encountered attempting to make a code insight which parses the original search query to add filters for fork, archive and repo before turning it back into a string to submit the search.
filePath.Clean( AND NOT filepath.Clean(filePath.Join("/",
When parsed this returns:
[
{
"and": [
{
"value": "filePath.Clean(",
"negated": false,
"labels": ["Literal"],
"range": {
"start": { "line": 0, "column": 0 },
"end": { "line": 0, "column": 15 }
}
},
{
"value": "filepath.Clean(filePath.Join(\"/\",",
"negated": true,
"labels": ["Literal"],
"range": {
"start": { "line": 0, "column": 20 },
"end": { "line": 0, "column": 57 }
}
}
]
}
]
When this is converted back to a string using StringHuman the following is returned:
(filePath.Clean( AND (NOT filepath.Clean(filePath.Join(\"/\",))
This was not returning any results so to investigate further I parsed this query and saw that the values for each step have changed.
[
{
"and": [
{
"value": "(filePath.Clean(",
"negated": false,
"labels": ["HeuristicDanglingParens", "Literal"],
"range": {
"start": { "line": 0, "column": 0 },
"end": { "line": 0, "column": 16 }
}
},
{
"value": "(NOT filepath.Clean(filePath.Join(\"/\",))",
"negated": false,
"labels": ["HeuristicDanglingParens", "Literal"],
"range": {
"start": { "line": 0, "column": 21 },
"end": { "line": 0, "column": 25 }
}
}
]
}
]
/cc @sourcegraph/search-product
The following search string when Parsed then returned to a string with
StringHumanand Parsed again is producing different results. This was encountered attempting to make a code insight which parses the original search query to add filters for fork, archive and repo before turning it back into a string to submit the search.filePath.Clean( AND NOT filepath.Clean(filePath.Join("/",When parsed this returns:
[ { "and": [ { "value": "filePath.Clean(", "negated": false, "labels": ["Literal"], "range": { "start": { "line": 0, "column": 0 }, "end": { "line": 0, "column": 15 } } }, { "value": "filepath.Clean(filePath.Join(\"/\",", "negated": true, "labels": ["Literal"], "range": { "start": { "line": 0, "column": 20 }, "end": { "line": 0, "column": 57 } } } ] } ]When this is converted back to a string using
StringHumanthe following is returned:This was not returning any results so to investigate further I parsed this query and saw that the values for each step have changed.
[ { "and": [ { "value": "(filePath.Clean(", "negated": false, "labels": ["HeuristicDanglingParens", "Literal"], "range": { "start": { "line": 0, "column": 0 }, "end": { "line": 0, "column": 16 } } }, { "value": "(NOT filepath.Clean(filePath.Join(\"/\",))", "negated": false, "labels": ["HeuristicDanglingParens", "Literal"], "range": { "start": { "line": 0, "column": 21 }, "end": { "line": 0, "column": 25 } } } ] } ]/cc @sourcegraph/search-product