In IntelliJ (and WebStorm), when working on a JavaScript project (React, NPM), you can have the IDE download TypeScript community stubs in Preferences | Languages & Frameworks | JavaScript | Libraries. They allow the editor to provide Parameter info to you.
However, when enabled, Go To | (Type) Declaration or Go To | Implementation(s) always jumps to the library's corresponding index.d.ts file in External Libraries | @types - which isn't
exactly useful when you are looking for documentation, comments, or implementation details.
Is there a way to support Parameter info but at the same time jump to the right location in node_modules/ when using the Go To context menu command (or make the Quick Documentation work)?
Current behavior depends on a way d.ts files are defined and included.
type definitions, if available, are always used for completion
If type definitions are installed in the @types folder, IDE will try to navigate to the JavaScript sources of the library when using Navigate | Declaration. Please note that this only works for symbols that are defined as classes, variables or functions (and not interfaces or types) in the .d.ts file. If all symbols in d.ts are defined as types or interfaces, that makes it impossible to map them to the actual code.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With