-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: add ignore_pattern option to filter language lines #217
Conversation
Looks good! Small nitpick would be that the docstring is slightly wrong, lua match patterns are not exactly the same es regexes. But I can fix that later. Also a heads up: We now have so many arguments to otter activate that I will refactor it into using a table of keyword arguments, so how you call it will change. But you should get a deprecation warning then. |
docstring was an oversight whoops! I'm also trying to expand the match_pattern for a language into a table of strings to match multiple patterns, since lua pattern matching is limited in operators. (for instance OR |
Ignored pattern is matched as language line collection
Prefer to not remove lines if there's a match in 'ignore_patten' Ref: jmbuhr#217
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last thing. This will fail if there is no pattern for a language, so pattern will be nil and string.match will fail. So we should only attempt to match if pattern is not nil.
'ignore_pattern` for a language can be nil, causing string.match to fail. This commit adds checks before attemping to match. Ref: jmbuhr#217
Refs
#216
This PR adds an option to ignore matched patterns(for example: ipython cell magics) to send to LSP.
Todo:
match multiple patterns to ignore(prefer pattern matching once instead)