Does anyone have a good solution for @WebStormIDE (or whatever you're using) going to type definition files instead of actual source code with @typescriptlang ? cc: @kentcdodds , @ken_wheeler
-
-
Replying to @bmb21 @typescriptlang and
Hi, Ben! In WebStorm, go to definition will try to take you to the actual TypeScript sources and not to d.ts file if the sources are available and could be mapped. As an example, try navigation to any symbol imported from rxjs.
1 reply 0 retweets 2 likes -
Replying to @WebStormIDE @bmb21 and
Right, I think Ben's saying they _don't_ like that behavior and would prefer to be taken directly to the source regardless of the existence of type definitions.
1 reply 0 retweets 0 likes -
Replying to @kentcdodds @bmb21 and
Right. And WebStorm does take you to the sources instead of d.ts files. Right now, it doesn't work in 100% cases, but we try our best to support as many cases as possible. And if one wants to go to d.ts, there's a Go to type definition action.
1 reply 0 retweets 1 like -
Replying to @WebStormIDE @kentcdodds and
So here's an example: Go to declaration (cmd-click) -> .ts files Jump to source (not Go to type def, sorry) -> d.ts filepic.twitter.com/sTGe8N2HDO
1 reply 0 retweets 2 likes -
Replying to @WebStormIDE @kentcdodds and
Thanks so much, appreciate the help here. The way I'm publishing packages, type files exist as .ts and source files are .js. I *think* this is different than the rxjs example. Any thoughts on whether this is a problem and if so how to configure Webstom to go to the .js file?
1 reply 0 retweets 0 likes
In this case, please try using Go to Implementation if you're in a .ts file. With the current implementation, Go to declaration from a .ts file looks for .ts, then for .d.ts, but not for .js (we assume that when writing TS, you would prefer type info available in .d.ts)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.