[英]VS Code “Go To Definition” does not exist - Javascript
I am using VScode version 1.57.我正在使用 VScode 1.57 版。
The issue is that it Simply cant not navigate to the definition, "Go To definition" not working.问题是它根本无法导航到定义,“转到定义”不起作用。
as you can see in an image it does not exists.正如您在图像中看到的那样,它不存在。
What I have tried:我尝试过的:
simply need to navigate to definition, I searched through documentation of VSCode it must read Javascrit files, I even added jsx and js next to ts, tsx but in this simple example below it still does not work.只需要导航到定义,我搜索了 VSCode 的文档,它必须读取 Javascrit 文件,我什至在 ts、tsx 旁边添加了 jsx 和 js,但在下面的这个简单示例中,它仍然不起作用。
Your import is importing the entire ./test.js
file as the variable sum
thus there is no single method definition as you are expecting.您的导入将整个
./test.js
文件作为变量sum
导入,因此没有您期望的单一方法定义。
If you want sum to be your actual function called sum
you need to change your import
statement to:如果您希望 sum 成为名为
sum
的实际函数,则需要将import
语句更改为:
import { sum } from './test'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.