Can you tell me please how to calculate this property correctly? Lezer Reference Manual this
Right now my highlighting is not working accurately, it does not fall in the right range.
I tried to use the start position for all children, use offset relative to 0, and also paid attention to this property Lezer Reference Manual (but I don’t think it’s about that…).
How should the positions for the bold node of the following tree look like?
root [0-7]
bold [0-7]
operator [0-1] ("*")
text [1-6] ("hello")
operator [6-7] ("*")
When i use start positions [0, 1, 6] (I subtracted from the initial position of each child node the initial position of the parent node) for bold node it doesn’t work
My full CM Tree
{
"length": 7,
"positions": [
0
],
"type": {
"flags": 1,
"id": 1,
"name": "root",
"tags": [
{
"id": 990
}
]
},
"children": [
{
"length": 7,
"positions": [
0,
1,
6
],
"type": {
"flags": 0,
"id": 18,
"name": "bold",
"tags": [
{
"id": 1007
}
]
},
"children": [
{
"length": 1,
"positions": [],
"type": {
"flags": 0,
"id": 5,
"name": "operator",
"tags": [
{
"id": 994
}
]
},
"children": []
},
{
"length": 5,
"positions": [],
"type": {
"flags": 0,
"id": 3,
"name": "text",
"tags": [
{
"id": 992
}
]
},
"children": []
},
{
"length": 1,
"positions": [],
"type": {
"flags": 0,
"id": 5,
"name": "operator",
"tags": [
{
"id": 994
}
]
},
"children": []
}
]
}
]
}