IntelliJ IDEA Ultimate 11.1.2 Dart Plugin, Setup Hello World
Hello JetBrains:
I've watched the screencast (http://www.screenr.com/L3r8) for WebStorm, and attempted to setup both a Java Module and Web Module in IDEA, but it seems that no matter what I do; my simple hello world script generates some sort of syntax error before the print statement:
main() {
print('Hello, Dart!');
}
The error says something to the effect:
';' expected, got print
Any help getting up and running? Dart seems like a very cool language and I would love to explore it in my favorite IDE.
请先登录再写评论。
Hi Matthew,
So you are using IntelliJ IDEA Ultimate 11.1.2 with the latest Dart plugin(0.3.3). You have java module and web module. And you've created some test.dart file in web module with only three lines of code:
main() {
print('Hello, Dart!');
}
Right? Because that is realy strange situation and I want to clear up about your environment and workflow.
Best,
Fedor
Hi Fedor,
Thanks for taking the time to address my problem. What you've described is my setup. I did the following.
Environment:
- IntelliJ IDEA Ultimate 11.1.2 Build: #IU-117.418
- Dart Editor + SDK rev 9474
- Dart Plugin for IDEA v 0.3.3
Repro Steps:
1) File -> New Project -> Create Project From Scratch
Project Name: DartWebProjectTest
Project files location: C:\dev\workspaces\idea\DartWebProjectTest
Create Module: True
Module Name: DartWebProjectTest
Content Root: C:\dev\workspaces\idea\DartWebProjectTest
Module file location: C:\dev\workspaces\idea\DartWebProjectTest
Module Type: Web Module
2) Click Dart Settings Button
SDK Home Path: C:\dev\tools\dart\dart-sdk
Dart SDK revision 9474 is set up
3) Edit usage scope
C:\dev\workspaces\idea\DartWebProjectTest -> Dart SDK
4) Right click Module Root in Project pane -> New File -> test.dart
enter text into editor:
main() {
print('Hello, Dart!');
}
Expected Results: No errors
Actual Results: whitespace before print function call is highlighted red with a red squiggly underline.
Top right error indicator says Analysis completed 2 errors found
The errors are
'!','(','+','++','-','--',<,HEX_NUMBER,'IDENTIFIER,NUMBER,OPEN_QUOTE,RAW_SINGLE_QUOED_STRING,RAW_TRIPLE_QUOTED_STRING,'[',assert,break,const,continue,do,false,final,for,if,new,null,return,static,super,switch,this,throw,true,try,var,while,'{','~', expected got ' '
and
';' expected got print
Thank you for great response!
Unfortunately I can't reproduce. Could you please attache the DartWebProjectTest/.idea folder?
Best,
Fedor
Hi Fedor,
Sorry for the delayed response, I went ahead and created an issue in Youtrack. Let me know if there is anything else I can do to help.
http://youtrack.jetbrains.com/issue/IDEA-88808
Thanks!