Skip to content

Explanations about the Issue Reporting Checklist

Louis-Dominique Dubeau edited this page Apr 8, 2018 · 3 revisions

Prior to filing an issue, we ask you to go through a checklist. This document explains the rationale for the checklist and how to interpret the results of tests we ask you to perform.

Use the Latest Version of the Relevant Packages

The latest version of tide may have the necessary fix for the problem you encountered. Therefore, you should upgrade the relevant Emacs packages to their latest version. You can get from MELPA the latest version of tide and typescript-mode. If the problem goes away when you use the latest version, then there is nothing for us to fix.

Try M-x tide-restart-server

A lot of the functionality that tide provides is provided through tsserver. Tide launches one tsserver per project. tsserver runs as a process separate from Emacs. When you issue M-x tide-format, tide sends your source to tsserver and tsserver returns the formatted source to tide, which replaces the content of your buffer with the formatted source. When you issue M-x tide-fix, tide asks tsserver for a list of possible fixes at the location where you issued your command.

You may run into problems that are due to a disconnect between the state of tsserver and what you expect that state to be. For instance, if you start editing a project with tide, and your project uses TypeScript 2.7.1, then tide will start the tsserver included with that version of TypeScript. Suppose you then upgrade to TypeScript 2.8.1, which is the first public release to include support for conditional types. If you start using the conditional type syntax immediately in the project you were already editing in tide, you'll run into errors. Why? Because tide is still using the tsserver it had started with TypeScript 2.7.1, which does not understand conditional types. You can force tide to use the new tsserver that was installed with TypeScript 2.8.1 by issuing M-x tide-restart-server.

There are also cases where tsserver will fail to detect changes to a tsconfig.json file. Again, restarting the server fixes the issue. (If you run into such cases, the problem is not with tide but with tsserver itself, and any issue you file should be filed with the TypeScript project, not here.)

Check the Information Reported by M-x tide-verify-setup

M-x tide-verify-setup will report the version of tsserver and the path to the tsconfig.json file used for your project. If either of them is not what you expect, then chances are that you made a mistake in your tide configuration, or your tsserver needs to be restarted (see above).

The Behavior of CLI Tools Agrees with Your Expectations

Before filing your issue, you should run the CLI tools and check that their behavior agrees with the behavior you are expecting from tide. The CLI tools you should check usually include tsc. If the problem has to do with a linting error, you should also check your linter (usually, tslint).

For instance, tide reports an error at import { foo } from "library" that says it cannot find "library". In your mind tide should not be reporting an error there. Ok, so you run tsc from the command line. If it does also report that it cannot find "library", then the problem is not with tide but with your TypeScript configuration.

How to Determine Which Project the Problem Belongs to?

Usually people using tide are dealing with three related projects:

  1. Tide itself.
  2. typescript-mode.
  3. TypeScript, through tsserver.

Here are some general rules-of-thumb that can help determine where a problem belongs:

  • Fontification problems belong to typescript-mode.
  • Hitting the TAB key misindents your line: that's a problem that belongs to typescript-mode.
  • M-x tide-format formats your code, but not in the style you expect: that's a problem that belongs to tsserver.
  • If you find an issue report for tsserver that describes the same problem you've encountered, then you've run into a tsserver issue.

We realize it may be difficult to determine exactly where a problem belongs, but you should be aware that if you file an issue with tide that belong somewhere else, we'll ask you to file your issue in the right place and close it here.