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

tide-fix and typescript-tslint-plugin #288

Open
7 tasks done
jupl opened this issue Nov 23, 2018 · 0 comments · May be fixed by #289
Open
7 tasks done

tide-fix and typescript-tslint-plugin #288

jupl opened this issue Nov 23, 2018 · 0 comments · May be fixed by #289

Comments

@jupl
Copy link

jupl commented Nov 23, 2018

When submitting issues to this project, please include the following information.

Checklist

  • I can reproduce the problem with the latest version of the relevant packages.
  • I have searched both open and closed issues and cannot find a duplicate.
  • The problem still occurs after I issued M-x tide-restart-server in the buffer where I had the problem.
  • I verified that the version and the configuration file path reported by M-x tide-verify-setup are correct.
  • If tide is reporting an error or warning I think should not be reported, I can run tsc (and tslint, if applicable) without the error or warning I'm seeing in tide.
  • If tide is not reporting an error or warning I think should be reported, tsc (or tslint, if applicable) reports the error or warning I was expecting to see.
  • I am positive the problem does not belong to typescript-mode or tsserver.

Relevant Version Numbers

  • Tide: 20181025.1201
  • TypeScript: 3.1.6
  • Emacs: 26.1

(The list above is minimal. Make sure to include any other version numbers relevant to your report.)

Steps to Reproduce the Bug

I have been using this plugin to view TSLint violations in different editors, and for me it works better with a project over Flycheck. I noticed that there is a tide-fix command and when I run it I do get options to fix the command under the cursor.

screen shot 2018-11-22 at 9 07 30 pm

If I select a or s then the fixes work as expected.

screen shot 2018-11-22 at 9 07 40 pm

However, in the scenario below where I have multiple violations:

screen shot 2018-11-22 at 9 09 29 pm

When I try to fix violations I get unexpected results:

screen shot 2018-11-22 at 9 09 39 pm

I have not gotten this issue with other editors so I can't say it's necessarily it's because of the typescript-tslint-plugin. I'm suspecting that tide own formatting fixes could be interfering.

Also, it would be nice if I can invoke these fixes without having to move my cursor under an error in question.

ananthakumaran added a commit that referenced this issue Nov 23, 2018
fixes #288

> Applying the edit instructions in reverse to file will result in correctly reformatted text.

One of the comments in TypeScript repo says the edits should be applied
in reverse order. But, I am not sure all the plugins follows this? Doing
a manual sort does seem to fix the tslint issue. VS code applies the fixes
correctly, but I can't able to find the logic. Atom[1] also manually
sorts the edits.

1: https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/pluginManager.ts#L349-L352
@ananthakumaran ananthakumaran linked a pull request Nov 23, 2018 that will close this issue
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 a pull request may close this issue.

1 participant