tomwanzek / d3-v4-definitelytyped

[DEPRECATED] This repo was intended as a staging area for typescript definitions supporting the latest major release of D3js (i.e. version 4.1.x) by Mike Bostock. It has been migrated to DefinitelyTyped.
MIT License
53 stars 14 forks source link

webstorm autocompletion #127

Closed ITsvetkoFF closed 7 years ago

ITsvetkoFF commented 7 years ago

@tomwanzek, thanks for your work! You rocks!

Still experiencing some problems with getting all this work (auto-completion in webstorm). Tried your d3-ng2-demo and saw that is has no auto-completion from the box too...

maybe something specific?

Also the third step of temporary workaround (Add the hand-crafted definition file to your project compilation context) is not 100% clear for me... did you mean adding created d.ts file to "typeRoots": [] compiler option?

tomwanzek commented 7 years ago

Thanks @ITsvetkoFF. As I am not working with Webstorm (using VSCode), I am not sure, why autocomplete does not work when you install from npm install @types/d3-MODULE and use typescript module imports. d3-ng2-demo should certainly work out of the box. (Have not heard an issue similar to yours yet.)

Is there any additional setting necessary to ensure Webstorm uses TypeScript2? For some time VSCode used TS 1.8.x as its built-in default, in which case there was an explicit workspace setting to tell it, to use a different TS version. While this has changed with the official release of TypeScript 2, maybe it is something similar with Webstorm?

I am assuming your last paragraph refers to the DefinitelyTyped issue pertaining to the D3 standard bundle definitions? Which are not yet published in version 4. We are currently trying to remedy that, see today's updates under issue DT 11367.

tomwanzek commented 7 years ago

@ITsvetkoFF if you run npm install @types/d3 --save you will now get the definitions for the D3 v4 Standard Bundle. This should address your question regarding the 'temporary workaround'... No longer needed. 😄