mockdeep / typewiz

Automatically discover and add missing types in your TypeScript code
https://medium.com/@urish/manual-typing-is-no-fun-introducing-typewiz-58e3e8813f4c
1.1k stars 46 forks source link

Type added in wrong place #61

Open Archon- opened 6 years ago

Archon- commented 6 years ago

Steps to reproduce:

  1. Use demo exmaple for Webpack.
  2. Remove definition and usage of displayTypeInfo function.
  3. Run apply-types task.

Actual results: string type is put in wrong place. See attachment. zrzut ekranu 2018-04-16 o 14 52 53

Expected Type is located in correct place.

urish commented 6 years ago

Thanks for reporting!

Basically, if I understand correctly, you ran apply-types, and then removed the definition of displayTypeInfo, and then ran apply-types again using the collected type information from the first run?

If so, then this is same as #36 - basically, after running applyTypes once, the source code has already been modified, so the offsets in the collected JSON files are no longer valid. This should improve once #34 is implemented.