Imagine I have the following code snippet in my VS Code:
type T1 = { x: number };
type T2 = { x: number } & { y: string };
function foo(arg1: T1, arg2: T2) {}
If I place my cursor on arg1
and go to the type definition (either through the menu or a shortcut), it correctly takes me to the definition of T1
. However, if I do the same for arg2
, it displays "no type definition found for 'arg2'.
It appears that for types using &
, I am unable to retrieve the type definition. I am running VS Code 1.79.0 on Windows 10.
Could this be a bug or am I overlooking something?
Edit: Here is the content of my tsconfig.json file:
{
"include": [ "*.ts" ],
"compilerOptions": {
"target": "es2022",
"module": "commonjs",
"moduleResolution": "node",
"strict": true
}
}