IntelliJ IDEA无法正确识别Dart项目,因为使用了Melos。

huangapple go评论53阅读模式
英文:

Intellij Idea is not recognizing the dart project correctly since using melos

问题

I upgraded my project to be based on a multi-package architecture a few weeks ago.
My primary pubspec.yaml contains path references to those feature or library packages.

To be able to manage this mono-repo I recently introduced melos.

Now I have the problem that I cannot use Intellij any more as it doesn't recognize the project correctly:

  • I don't see any project errors any more
  • I don't see any code suggestions any more
  • I cannot use shortcuts any more to e.g. jump into the implementation or the definition of a class
  • and so on (The project structure seems to be broken)

What I tried to address this issue so far:

  • I already ran Repair IDE in Intellij with all checkboxes marked including Invalidate Caches & Restart in the end
  • I did this again but ran melos clean before and melos bs (bootstrap) after restart.
  • I checked my melos.yaml to see that all the packages are correctly referenced.

So what else could be the problem for such a behaviour?

Running the project in VS Code works so it is related to Intellij.

英文:

I upgraded my project to be based on a multi-package architecture a few weeks ago.
My primary pubspec.yaml contains path references to those feature or library packages.

To be able to manage this mono-repo I recently introduced melos.

Now I have the problem that I cannot use Intellij any more as it doesn't recognize the project correctly:

  • I don't see any project errors any more
  • I don't see any code suggestions any more
  • I cannot use shortcuts any more to e.g. jump into the implementation or the definition of a class
  • and so on (The project structure seems to be broken)

What I tried to address this issue so far:

  • I already ran Repair IDE in Intellij with all checkboxes marked including Invalidate Caches & Restart in the end
  • I did this again but ran melos clean before and melos bs (bootstrap) after restart.
  • I checked my melos.yaml to see that all the packages are correctly referenced.

So what else could be the problem for such a behaviour?

Running the project in VS Code works so it is related to Intellij.

答案1

得分: 1

I found the issue:

Short answer --> manually delete all your iml files and run melos bs again

Explanation: melos automatically creates iml files which are named like melos_module.iml. Two of my packages still had an old iml file called module.iml. melos clean on the other hand didn't remove all iml files nor did Repair IDE do such a thing. So the problem with the two redundant files was never solved.

After manually removing all iml files in the project and running melos bs again I have a running project again.

英文:

I found the issue:

Short answer --> manually delete all your iml files and run melos bs again

Explanation: melos automatically creates iml files which are named like melos_module.iml. Two of my packages still had an old iml file called module.iml. melos clean on the other hand didn't remove all iml files nor did Repair IDE do such a thing. So the problem with the two redundant files was never solved.

After manually removing all iml files in the project and running melos bs again I have a running project again.

huangapple
  • 本文由 发表于 2023年6月29日 18:31:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76580202.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定