Intellij 13 with Dart plugin, no Dart: Build option listed

I posted this under the comments on the plugin page, but I thought I would add it here in case it was a better place for the discussion.

I am currently using Intellij 13 Ultimate with the Dart plugin.  Overall things are working well, however I noticed in the latest plugin notes it was mentioned that there is support for doing "Pub: Build" on the pubspec.yaml file similar to the Dart Editor.  However, when I right click on the file I don't get any option for doing the build in my project.  I assume it should look similar to the Webstorm screen shot shown here under the Package Management section:  

I enabled the Dart SDK in the latest version of the plugin under Project Settings -> Dart.  However, it didn't resolve the issue.  I notice that when I go to Project Structure->Project "No SDK" is listed under my Project SDK.  When I choose "New" the Dart SDK is not listed.  Am I missing a step here?  Should I be able to add the Dart SDK under the Project Settings page in Intellij?  Right now it just shows my Java and Android SDKs.

The workaround I am using for now is to set up a File Watcher for Dart2JS and make a html page that explictily uses the generated Javascript file.  It seems to work fine, but it would be great to have the Pub build support working if it has been added.


Comment actions Permalink

Yes, forum is a better place for discussion.

Project Structure->Project "No SDK" is listed under my Project SDK.  When I choose "New" the Dart SDK is not listed.

That's ok. Dart SDK is configured in Settings | Dart.

As I already answered in personal message the problem was in your project configuration. In fact pubspec.yaml file didn't belong to any IntelliJ IDAE module.
In your case the project should contain only one module of Web type with root  folder as content root and that's all.

Comment actions Permalink


I replied to you in a personal message, but it may be best to answer here for other people that have the same issue.  The idea files you provided fixes the problem, thank you for that.

It would be great if you could illustrate what your process was in Intellij to fix the issue, so I can follow it for future projects.  I started with the project provided here:

I did a "File->Import Project" and then selected the top level directory, then chose "Create project from existing sources".  The non-working project structure is what was created for me automatically by Intellij.

Thanks again for the help,

Comment actions Permalink

I think I may see the fix.  So do I remove the default content root that points to the "web" sub directory and instead move it to the top level directory?  That seems to resolve the issue.  It would be great if Intellij defaulted to using the directory I started with instead of jumping down in to the "web" sub directory.

Comment actions Permalink

'Import project' functionality doesn't work perfectly for Dart yet. Related issue:
I did the following: File | New Project, selected 'Web' project type (in Static Web section). You shouldn't select Dart Web Application here if you are creating project based on existing sources. Then I selected project location and clicked Finish.


Please sign in to leave a comment.