WebStorm not AutoComplete local typescript packages

I'm working with WebStorm 16.2, And i am developing node.js application using TypeScript.

My application is devided to some local packages that some have dependencies to other local packages(In my package.json's dependencies, it is local path to the packages).

My problem is that webstorm does not autocomplete code when im using classes and methods from my local packages.

For example: Suppose i have in my app package A that exports some classes(for Example Animal).
And I have module B That his package.json look like:

{
  "name": "B",
  "dependencies": {
  "A": "file:../A"
  }
}

And when i am trying to use methods of Animal from package A in package B, it does not auto complete.
This is makes it very difficult to work like that in typescript.
Maybe i am doing something wrong? maybe i should configure webstorm differently when working with local packages?
Thanks alot.

5 comments

Please can you elaborate on this? Are all these packages located in the same project? How do you import them? Sample project would be helpful

0

yes they are all located in the same project.

every folder is package(it contain package.json), and some of them have dependencies to other packages located in my project.

From npm v2, there is support for local dependency path written here.

In my dependent packages, inside my package.json, i wrote "typings" property that lead to my index.ts(where all my classes exports defined.

Similar, but not exactly the same, example would be project i found here.

0

can't see any issues when using similar projects (I'm using 2017.1 EAP, but 2016 should work in similar way. Please check the sample project I've uploaded to ftp: ftp://ftp.intellij.net/pub/.idea/npm_local/npm-local-dep.zip. Package p2 there depends on local package p1. Can you recreate the issue using it?

0

wow i think this is the very same thing im doing in my own project at office.

the project in my office is inside local network, tomorrow i will compare the two to see the difference.

Some facts that maybe related:

- At my office im using webstorm version 2016.2 and not 2016.3 as in my own pc.

- The tsconfig is inside every package, and not in the root project.

- Im using outDir in my tsConfig, to generate the js package to different folder.

- In Settings -> TypeScript im using "Use tsconfig.json" option.

- The webstorm is running inside local network.

I dont know what i wrote is relevant, but im trying...

I will write another comment after i will compare them tomorrow.

Thank you very much for your help!

 

0

I really could not find the difference between the projects... i guess i will try to upgrade webstorm version and try again. Thank you for your help!

0

Please sign in to leave a comment.