Extension causes "go to definition" to go to type definition
kylemh opened this issue · 4 comments
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
1.8.9 and styled-components@^5
Link to runnable example
No response
Steps to reproduce
- Use Next.js starter
- Install
styled-components@^5
- Install @types/styled-components`
- Install MDX VS Code extension
- Define some simple component and render it on
app/page.tsx
orsrc/app/page.tsx
orpages/index.tsx
orsrc/pages/index.tsx
: a lá:
const BlueText = styled.p`
color: blue;
`;
- In VS Code, right-click on the "BlueText" part of
<BlueText>Test</BlueText>
- Click "Go To Definition"
- Be taken to type definitions instead of your inline definition of
BlueText
Somebody else saw this problem, too: microsoft/vscode#211725
Expected behavior
I should be taken to source definition, especially with "typescript.preferGoToSourceDefinition": true
Actual behavior
I am taken to type definition
Runtime
Node v18
Package manager
pnpm
OS
macOS
Build and bundle tools
Next.js
I’m unable to reproduce. I tried it with both 1.8.9 and 1.8.10. Does the problem still exist for you? If so, please provide a repo with a minimal reproduction.
Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:
- Spend time framing the issue! The more time you put into it, the more we will
- Often, maintainers respond with why for several back and forths; rubber duck debugging might help avoid that
- Folks posting issues sometimes fall for xy problems: asking for a certain solution instead of raising the root problem
Thanks,
— bb
The problem existed until I removed the extension! It was happening on a work repo and - once I saw that comment in the TS repo - I attempted the minimum repro that I shared. It's a bit tough for me to share a perfect reproduction because I can't control the Node version of online versions of VS Code. If you did the steps with the correct Node version and told VS Code to use the workspace version of TS (as opposed to the editor version), then I've got no clue! If I re-add, I continue to get the same issue.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.