Hi Actipro,
I added 2 outlining nodes whose range overlaps each other. The outcome of the collapsible range is incorrect.
Here are the steps to reproduce:
- Navigate to [dir]\v16.1.0634\SampleBrowser\ProductSamples\SyntaxEditorSamples\QuickStart\CodeOutliningRangeBased\JavascriptOutliningSource.cs
- Change the Outlining Source to manually add 2 nodes:
-
var firstRange = new TextRange(snapshot.PositionToOffset(new TextPosition(0, 0)), snapshot.PositionToOffset(new TextPosition(10, 0))); var secondRange = new TextRange(snapshot.PositionToOffset(new TextPosition(5, 0)), snapshot.PositionToOffset(new TextPosition(20, 0))); this.AddNode(firstRange, multiLineCommentDefinition); this.AddNode(secondRange, curlyBraceDefinition);
- Observe that the first node is from line 1-11 (still correct) but the second node is from line 6-11 (instead of line 6-21).
In Visual Studio, similar overlapping range can be achieved with the following code block; where the first range is for the #region-endregion pair and the other range is for the class Foo's brackets.
#region
class Foo
{
#endregion
}
Would you be able to fix this, please?
Thank you.
Regards,
Erwin Liong