简体   繁体   English

VSCode 的查找所有引用/转到定义不起作用

[英]VSCode's Find all references/Go to definition does not work

I have:我有:

  • mono repository, more projects inside mono 存储库,里面有更多项目
  • js/ts, react js/ts,反应
  1. When Find all references is tried on react component (I suppose on anything) that is imported in another project inside monorepo, it starts finding references.当在 monorepo 内的另一个项目中导入的反应组件(我想是任何东西)上尝试查找所有引用时,它开始查找引用。
  2. Initializing JS/TS language features starts - from Typescript and Javascript Language Features built-in extension.初始化 JS/TS 语言功能开始 - 从 Typescript 和 Javascript 语言功能内置扩展。
  3. It takes about 2 minutes (depends on project size)大约需要 2 分钟(取决于项目大小)
  4. After that references outside project/folder are not found之后找不到项目/文件夹之外的引用
  5. During that process I cannot use Go to definition在那个过程中,我不能使用Go 来定义

I have also solution and will be written in answer below to help other folks (maybe my future me:D) to not waste halfday as I did on this;)我也有解决方案,并将写在下面的答案中,以帮助其他人(也许是我未来的我:D)不要像我那样浪费半天时间;)

  1. Go to VSCode settings (Mac -> CMD +,) Go 到 VSCode 设置 (Mac -> CMD +,)
  2. Find Max TS Server Memory and raise it to 8000 MB (might be more or less, depends on your project size)找到 Max TS Server Memory 并将其提高到 8000 MB(可能或多或少,取决于您的项目大小) 在此处输入图像描述

Enjoy charm working:)享受魅力工作:)

Explanation: I suppose tsserver seemlessly crashed down once it hit max memory during indexing whole project.说明:我想 tsserver 在索引整个项目期间一旦达到最大 memory 就会无缝崩溃。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM