-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex implementation for tour resiliency #141
Comments
Rather than using a regex (bit tedious), there are a couple of other options:
|
Hey! So CodeTour actually currently supports adding "code markets" like you showed, but we found that most users don't want to add this clutter to their code. And so we haven't updated the tour to accommodate it. Regarding regex, we actually don't expect the end user to have to author these manually. When you record a tour, we'll capture a regex of the selected line and simply use that instead of the line number. That would allow the line to be moved around the file and not require the tour to change. This would also make it easy to diagnose/fix a tour if it gets broken, because the step would provide a hint for what it was originally associated with (whereas a line doesn't really help with that). You can try this out right now by setting the Furthermore, I'm working on support for auto-updating the tour if/when the line's contents change. Ideally we could do this without requiring any end-user intervention. |
Any update on this @lostintangent. Need any help? |
Hey! Yeah I'd love some help here. I actually implemented a basic version of regex-based recording/playback, but it's not enabled by default. I've considered enabling this by default, but I'd love to get more testing on it. If you follow the instructions from my previous comment, you can give the regex based behavior a try, and let me know how well it works. |
I have been using the regex version. Works great for the use case. What seems to be missing is able to update the regex expression when the line changes. Even if there is manual button to update the regex as per current line will be helpful until the auto-updating feature is implemented. Right now I have copy the step text, delete the step and create a new step on the same line so I get updated regex. Another thing I noticed is that sometimes I get line number or selection range gets added to the current step which overrides the regex expression but haven't been able to identify what causes this. Have to manually edit the json and remove the line number when its added. Let me know if you need help with any of these. |
Using current CodeTour Or apply #260: I confirm that current |
Instead of attaching tours to code using line numbers, we can explore an implementation using Regex instead.
Creating tour step
Editing tour step
Editing code
Removing code
The text was updated successfully, but these errors were encountered: