Skip to content
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

Fix TAP nearest to support multiline match #508

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

codeinabox
Copy link
Collaborator

No description provided.

@codeinabox
Copy link
Collaborator Author

@janko I know understand why this isn't working, it's because test#base#nearest_test_in_line goes through line by line which means that multi-line matching for test nearest isn't currently possible. Any suggestions on how to proceed with this?

@janko
Copy link
Member

janko commented Aug 15, 2020

Not sure, line-by-line matching is needed to detect nesting. I don’t know how to handle multiline matching as well 🤔

@codeinabox
Copy link
Collaborator Author

What if test nearest match started at a single line and then kept expanding in range in both directions till a match was found? For example I run it at line 12 and it searches that line, then tries lines 11 to 13, then 10 to 14 and so forth.

@janko
Copy link
Member

janko commented Aug 15, 2020

I don’t know exactly how you would calculate indentation with regexes. Currently the code updates some state after each line. And it’s only going up from the current line IIRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants