In the app/page.tsx file in the Next.js app dir example cmd-clicking on the styles.code property to trigger Go to Definition in VS Code shows an extra entry of the node_modules/next/types/global.d.ts file with the *.module.css type definition.

This makes it no longer a one-click Go to Definition interaction. It would be great to get rid of these generic *.module.css / *.module.scss / *.module.sass entries so that it's a single click again.
This is also a problem with other extensions:
Potential approach
It seems that @zardoy has found a potentially interesting approach in his extension TypeScript Essential Plugins (repo). Some interesting parts of the code:
proxy.getDefinitionAndBoundSpan = (fileName, position) => {
const prior = info.languageService.getDefinitionAndBoundSpan(fileName, position)
// ...
prior.definitions = prior.definitions.filter(({ fileName, containerName, containerKind, kind, name, ...rest }) => {
// ...
if (moduleDeclaration?.name.text === '*.module.css') return false
return true
})
// ...
})
If I'm understanding correctly, this is filtering out previous definitions if they have the name *.module.css, which could also be extended to include *.module.scss and *.module.sass.
In the
app/page.tsxfile in the Next.js app dir examplecmd-clicking on thestyles.codeproperty to trigger Go to Definition in VS Code shows an extra entry of thenode_modules/next/types/global.d.tsfile with the*.module.csstype definition.This makes it no longer a one-click Go to Definition interaction. It would be great to get rid of these generic
*.module.css/*.module.scss/*.module.sassentries so that it's a single click again.This is also a problem with other extensions:
Potential approach
It seems that @zardoy has found a potentially interesting approach in his extension TypeScript Essential Plugins (repo). Some interesting parts of the code:
If I'm understanding correctly, this is filtering out previous definitions if they have the name
*.module.css, which could also be extended to include*.module.scssand*.module.sass.