英文:
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 IDEin Intellij with all checkboxes marked includingInvalidate Caches & Restartin the end - I did this again but ran 
melos cleanbefore andmelos bs(bootstrap) after restart. - I checked my 
melos.yamlto 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 IDEin Intellij with all checkboxes marked includingInvalidate Caches & Restartin the end - I did this again but ran 
melos cleanbefore andmelos bs(bootstrap) after restart. - I checked my 
melos.yamlto 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论