antonin.lebrard
antonin.lebrard

Reputation: 139

Dart packages problems with intellij IDEA

I'm actually trying to use Dart in IntelliJ IDEA, and I have successfully install the plugin for it, but I face numerous others problems.
But the problem I want to resolve the most, is the fact that for some packages, IntelliJ doesn't show the sources inside it and not with particular reason...
The whole project work in Dart Editor, and launch correctly, so the problem is not from pubspec.yaml.

To makes me more understandable, I will say that I "pub get" correctly the packages A and B, so they appear as folder link in IntelliJ :

https://i.sstatic.net/wOUKD.jpg

But like you see, I cannot enter in the b package to see the files inside it. I have checked the structure of the two folders without noticing any difference.

The more ridiculous in that is, I can see some of the files inside the B package in the editor of IntelliJ via Ctrl+Click in the dart files that import the files inside the B package. And it doesn't work for all of them ...

Upvotes: 2

Views: 1289

Answers (3)

Alexander Doroshko
Alexander Doroshko

Reputation: 1841

'b' is a 'path package' in your project. That means that b original source code is located on your computer and you specified path to it in pubspec.yaml. IntelliJ IDEA excludes all copies and leaves only original files in project. Root 'packages' folder is not excluded, but all its copies (for example in web folder) are excluded. packages/b is a copy and it is excluded. To work normally with source files from b package you should add path to b as a separate content root: Project Structure | Modules | your Dart module | Add content root.

In IntelliJ IDEA 14 excluded folders are visible by default. Use cases when you need to see excluded folder contents are rare so you may safely hide them (the option is under the gear in the Project View tool window title). With it you will see empty node in packages/b with a hint that it is just a link to b/lib folder. And anyway you should have path to b configured as a content root.

Upvotes: 2

antonin.lebrard
antonin.lebrard

Reputation: 139

The solution is to update IntelliJ to the Early Access update (139.2).
So this question will be useless in the next update, I will delete her at that moment.

Upvotes: 0

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657248

You should not open files of projects currently open in IntelliJ from the package folder but instead directly from the project. The b/lib after the folder icon indicates that this package is part of your currently opened IntelliJ project (may added as a Resource Root)

When you navigate to a referenced file ctrl+click the file is not opened from the packages symlink but from the package in your IntelliJ project (as you should do it manually as well).

Upvotes: 0

Related Questions