codehike
codehike copied to clipboard
Link and mark annotations on the same line
Here, the link annotation is applied to the wrong part of the line
```python mark=1[7:13]
# link[2:5] #foo
print("This is Code Hike")
```
did some debugging on this. Narrowed the bug down to \packages\mdx\src\smooth-code\splitter.tsx > getTokenGroups function. The groups returned have faulty tokens with them.
update.
I missed the mark the first go. The real culprit is the annotateLineTokenGroups in annotations.tsx It's a huge function that I don't fully understand yet, but it "binds" the CodeLink Component in this example to the third "group" instead of the first.
in this image, the annotation should be in the first element in annotatedGroups, but is in the last for some reason.
PS I couldn't get the tsx mappings to work properly on the debugger for this one. Not sure if this is a next thing or tsx thing. I debugged with no mappings.