-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement find_errors
and return LintMatch
es directly
#35
Conversation
19f7b2e
to
e926483
Compare
I wonder whether it would be reasonable to add this use case to the default configuration, even though it is specific to only rust. What do you think? |
Implementing Ideally you would override I actually dislike marking the whole line though. But you do fix #33 here which is nice. |
Fine with me. The documentation on Should I also change the I've been using the marks for the entire line until now and I grew rather fond of it. If you don't think it should be the default, I could and an option for it, but I believe marking the entire line is just more useful, because it makes it stand out more in code and in the minimap. |
That would be a mistake. If you use "comment" as selector, each view would be split in dozens of "lint-tasks". I don't think that overhead is worth it. In SublimeLinter land we have a fan-base for minimal UI so not underlining the whole line is probably a must. (No, really, we get more complaints about too prominent UI elements than the other way around.) FWIW, when you don't yield a column (just the line) SL will actually highlight the complete line if |
I think that should do it. Unfortunately I introduced a merge conflict with #34 because I added another setting for marking the remainder (the "message") of the comment line. |
This did initially not work because it was mixed with the other PR. (You used I switched to I also did some refactoring on the go. There is still the merge conflict with #34. |
Why is travis running here? I thought it is a paid service now? Do you have a paid account, @FichteFoll? I don't. |
lint
and return LintError
directlyfind_errors
and return LintMatch
es directly
07b7570
to
6079ba2
Compare
Instead of creating and then parsing a string with a regular expression, we can instead build and return a list of `LintError`s (a typed dict) directly and skip some indirection. I am not sure if `lint` is *supposed* to be overridden like this, but I do remember advocating for it a couple years ago when the change for a proper data structure for lint results was discussed. It just now happened to be a convenient way to implement end markers for the highlighted region. In this particular instance, it allows us to specify a full region for marking the error, where we now specify the entire match including the remainder of the comment instead of just the trigger word. This can be changed, of course, but I figured it wouldn't be a bad idea initially.
Since we need to track the region anyway, we might as well extract row and col from it.
6079ba2
to
31ec751
Compare
LGTM. Rebased onto Regarding Travis, I have an educational "PRO" account but I don't quite remember if that comes with perks for travis, especially since their change is rather recent. |
The "superfluous" I don't know how you rebased here but you took over the authorship of "26a5ea0 (Simplify |
I edited the commit and replaced |
Ok, interesting. In GitSavvy you would press |
Fixes #33
Instead of creating and then parsing a string with a regular expression,
we can instead build and return a list of
LintMatch
es (a typed dict)directly and skip some indirection.
I am not sure if(@kaste The implementation, the point to patch, haslint
is supposed to be overridden like this, but Ido remember advocating for it a couple years ago when the change for a
proper data structure for lint results was discussed. It just now
happened to be a convenient way to implement end markers for the
highlighted region.
changed,
lint
is considered private)In this particular instance, it allows us to specify a full region for
marking the error, where we now specify the entire match including the
remainder of the comment instead of just the trigger word. This can be
changed, of course, but I figured it wouldn't be a bad idea initially.
The motivation for this change was to allow for the trailing
!
mentioned in #34 to be marked, since it isn't a word character and thus wouldn't be picked up by the automatic region expansion from the marked character.Before (#34)
After (with #34)