Skip to content

Commit

Permalink
don't look at verbose markers
Browse files Browse the repository at this point in the history
  • Loading branch information
quinchs committed Mar 9, 2024
1 parent e035d58 commit ebaa4e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Reduce(IQueryBuilder builder, QueryWriter writer)
{
Action<QueryNode>? modifier = marker switch
{
_ when marker.Parent?.Type is MarkerType.Function => ApplyShapeReducer,
_ when marker.Parent?.Type is MarkerType.FunctionArg => ApplyShapeReducer,
_ => null
};

Expand Down
5 changes: 4 additions & 1 deletion src/EdgeDB.Net.QueryBuilder/Lexical/Marker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public Marker? Parent
if(marker == this)
continue;

if (marker.Type is MarkerType.Verbose)
continue;

if (marker.Position > Position || marker.Size < Size) continue;
if (bestMatch is null)
{
Expand All @@ -45,7 +48,7 @@ public IOrderedEnumerable<Marker> Parents
{
get
{
return _writer.Markers.Values.SelectMany(x => x).Where(x => x != this && x.Position <= Position && x.Size >= Size)
return _writer.Markers.Values.SelectMany(x => x).Where(x => x.Type is not MarkerType.Verbose && x != this && x.Position <= Position && x.Size >= Size)
.OrderBy(x => Position - x.Position + x.Size);
}
}
Expand Down

0 comments on commit ebaa4e4

Please sign in to comment.