Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Always show disable rule fix #36

Merged
merged 4 commits into from
Nov 29, 2018
Merged

Always show disable rule fix #36

merged 4 commits into from
Nov 29, 2018

Conversation

reduckted
Copy link
Contributor

Fixes #22.

This is a port of angelozerr/tslint-language-service#87.

These changes allow the "disable rule for the next line" fix to be shown when there are no other fixes available.

Basically, instead of only recording a failure if it can be fixed, the failure is always recorded along with a boolean that indicates whether it can be fixed. Then, anywhere that was previously looking at the recorded failures (which were always fixable) will filter the failures so that it only uses the fixable failures. The only exception to this is when adding the "disable rule for the next line" fix. It will add the fix regardless of whether the failure is fixable.

I've also renamed any variables called problem to failure to avoid any confusion about whether it's a tslint.RuleFailure or the new Problem interface I created, which is why there seems to be a lot of changes.

I've split the changes into separate commits to make it easier to see where I've actually change the logic. The first commit contains the actual change to get the "disable rule" quick fix to appear. The second commit contains all of the renaming.

@reduckted reduckted changed the title Feature/22 always show disable rule fix Always show disable rule fix Nov 28, 2018
@mjbvz mjbvz merged commit 3c2ba6a into microsoft:master Nov 29, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Nov 29, 2018

Thanks! I'll publish an update to the plugin shortly

@reduckted reduckted deleted the feature/22-always-show-disable-rule-fix branch December 30, 2018 11:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable rule is often not shown
2 participants