You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在VSCode中为未导入的隔离模块添加跳转链接?

To make @see links jump to your own isolated modules without importing them, you need to use module-specific path references instead of generic module: prefixes. Here's how to fix it:

Point directly to the module file containing the symbol, appending #SymbolName for named exports:

/**
 * @Component - main Renderer
 * @see {@link ./path/to/SystemRenderer#SystemRenderer}
 * @see {@link ../systems/SystemRenderer} // If it's the default export
 */
  • Replace ./path/to/ with the actual relative path from the current file to the SystemRenderer module.
  • The # suffix targets a named export (like a class or function) inside the module. Omit it if SystemRenderer is the default export of the file.

2. Use Module Aliases (Cleaner for Large Projects)

If your project uses TypeScript or has a module resolver configured, set up aliases in tsconfig.json (or jsconfig.json for JS projects) to shorten paths:

{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
      "@SYSTEMS/*": ["systems/*"]
    }
  }
}

Then reference the alias in your JSDoc:

/**
 * @Component - main Renderer
 * @see {@link @SYSTEMS/SystemRenderer#SystemRenderer}
 */

VSCode will resolve the alias using your config, linking directly to your project's module instead of global Node modules.

Key Notes

  • Avoid module:SystemRenderer — this prefix is reserved for Node.js core modules and global packages, which is why it’s pointing to the wrong place.
  • Ensure VSCode is using your project’s tsconfig.json/jsconfig.json (check the bottom-right corner of the editor to confirm).

内容的提问来源于stack exchange,提问作者jon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 10:16:03