8

When I want to reference a definition I press ctrl and left click on the variable, VSCode brings me to the definition. The problem is if a module has both index.js and index.d.ts, VS Code will bring me to the index.d.ts file which has no meaningful logic code. It's totally unusable to debug or to understand the implementation.

var cookieSession = require('cookie-session')
var express = require('express')

For example, ctrl + left click on the cookie-session VSCode brings me to ./node_modules/@types/cookie-session/index.d.ts:115 instead of ./node_modules/cookie-session/index.js where it shows:

declare module "cookie-session" {
    import express = require('express');

    function cookieSession(options?: CookieSessionInterfaces.CookieSessionOptions): express.RequestHandler;
    export = cookieSession;
}
starball
  • 20,030
  • 7
  • 43
  • 238
nezzz
  • 91
  • 5
  • Does this answer your question? [Go to implementation instead of TypeScript declaration](https://stackoverflow.com/questions/46893661/go-to-implementation-instead-of-typescript-declaration) – starball Feb 14 '23 at 08:59

0 Answers0