VSCode go to definition
Hi, just to ask here, when I click on go to definition in vscode, it takes me to the compiled function instead of where I actually implemented it. Is this by design?
3 Replies
Hi @simsima. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, this behavior is currently by design in Wasp projects when using VSCode. According to the information provided in the knowledge sources, there are a few key points to consider:
1. The current implementation does not take users directly to their original implementations when using "Go to Definition" for queries and actions. Instead, it takes them to the generated code Github Issue #1432 (https://github.com/wasp-lang/wasp/issues/1432).
2. This is acknowledged as a limitation, and there have been discussions about improving this behavior. The Wasp team is aware that jumping to the definitions of Actions and Queries should ideally take users to their implementations rather than the generated code Github Issue #1432 (https://github.com/wasp-lang/wasp/issues/1432).
3. There are ongoing efforts to improve IDE support for Wasp projects, including enhancing features like "Go to Definition" Github Issue #900 (https://github.com/wasp-lang/wasp/issues/900).
4. The Wasp team is exploring various solutions to this issue, including the possibility of using comments or a TypeScript Language Server plugin to direct users to the correct location Github Issue #1432 (https://github.com/wasp-lang/wasp/issues/1432).
While this behavior is currently as designed, it's worth noting that the Wasp team is actively working on improving IDE integration and support. They recognize the importance of providing a seamless development experience, including more intuitive navigation between source files.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @simsima, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Yes, this is a current limitation of Wasp and how we decided to implement the connection between Wasp's internal code and your code.
We are still exploring this topic and what we would like to have in the future is some sort of mapping so the IDE takes you to your code instead of our compiled version 🙂 https://github.com/wasp-lang/wasp/issues/1986
GitHub
Improve how go-to-definition behaves for Wasp SDK · Issue #1986 · w...
We want the Ctrl+click (go to definition) command to take the user to the symbol's definition inside a source file (TypeScript). What happens instead: For type definitions, we take them to the ...
ok makes sense, thank you