【问题标题】:Vscode make 'go to definition' for all functions in workspaceVscode 为工作区中的所有函数“转到定义”
【发布时间】:2020-02-21 13:45:36
【问题描述】:

a.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="a.js" type="text/javascript"></script>
    <script src="b.js" type="text/javascript"></script>
</body>
</html>

a.js

function a() {
    console.log("hi")
}

b.js

a();
console.log("done")

在 b.js 中,我想“去定义”到 a.js。

在实际项目中,有很多脚本。

有可能吗?除非打开所有 javascript 文件,否则我该怎么做。

【问题讨论】:

    标签: javascript visual-studio-code


    【解决方案1】:

    只需在目录的根目录中添加一个空的 jsconfig.json 文件即可解决此问题。

    只需使用{} 保存一个空白的 jsconfig.json 即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-04
      • 2022-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-17
      • 2019-11-04
      • 2023-03-16
      相关资源
      最近更新 更多