Flex/Mxml shows errors in IDEA 8.1

I am working on a project that uses Flex 2.0.1 sources and previously had the Flex SDK pointed at the 2.0.1 sdk directory from Flex Builder 3. Asside from an occasional attribute showing up as errored everything worked well enough under 8.0.   However I just upgraded my IDEA to version 8.1 and now all the flex components in my mxml editors are showing up Red with such messages as "attribute label is not allowed here."  Initially everything, including the components were Red and in error but I managed to get some of it to go away when I opened up the facet definition by definiing a global libarary with all the swc files from the 2.0.1\framework\libs directory included in it and assigning that library in the facet "Flex SDK library name" configuration.  Is there something more I need to configure?  I know there are some unusual things about how our flex sources are setup versus a standard project (our source directory starts right off the project root, not a seperate src folder) but IntelliJ mostly handled them before.  Now all the the attributes show up as in Error, which makes it very hard to work with.

Previously when we upgraded to 8.0 I tried looking for help getting it configured with our projects but couldn't find much (not even in the help docs) and mostly had to wing it to something that appeared to work.  Any help getting the configuration fixed now so that the editor is usable for us would be greatly appreciated, Thanks.

5 comments
Comment actions Permalink

Please, ensure your mxml files are under source roots of IDEA project.

Ronald Kinion wrote:

I am working on a project that uses Flex 2.0.1 sources and previously had the Flex SDK pointed at the 2.0.1 sdk directory from Flex Builder 3. Asside from an occasional attribute showing up as errored everything worked well enough under 8.0. However I just upgraded my IDEA to version 8.1 and now a
ll the flex components in my mxml editors are showing up Red with such messages as "attribute label is not allowed here." Initially everything, including the components were Red and in error but I managed to get some of it to go away when I opened up the facet definition by definiing a global libar
ary with all the swc files from the 2.0.1\framework\libs directory included in it and assigning that library in the facet "Flex SDK library name" configuration. Is there something more I need to configure? I know there are some unusual things about how our flex sources are setup versus a standard
project (our source directory starts right off the project root, not a seperate src folder) but IntelliJ mostly handled them before. Now all the the attributes show up as in Error, which makes it very hard to work with.

Previously when we upgraded to 8.0 I tried looking for help getting it configured with our projects but couldn't find much (not even in the help docs) and mostly had to wing it to something that appeared to work. Any help getting the configuration fixed now so that the editor is usable for us would
be greatly appreciated, Thanks.

---
Original message URL: http://www.jetbrains.net/devnet/message/5232030#5232030



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

They are.

I came in this morning and now the syntax is more or less showing more or less correctly.  The only thing I can think of is that IntelliJ needed to be restarted in order for it to read the libraries correctly.  It would also be helpful if the the Help documentation on the flex facet explained what the flex sdk library option was and how it was to be used.  I just assumed that when you define a flex sdk that it's libraries would be used in the facet.  I did not realize that when you define flex as a facet of a module that you would have to create a library included in your project plus refer to that library in the facet options.  The help documentation on the flex facet makes no mention of this.

I am still getting some false errors with my flex code though.  The errors seem to be on my custom components where the ActionScript is included as a seperate source file.  For instance, if I have custom component Foo.mxml our older code will often have a seperate script file Foo_script.as.  In the Foo_script.as file there will be something like a var bar:String variable (usually [Bindable]). When I refer to the Foo component in mxml and try to bind to the variable like this: "<Foo id="test" bar="{someString}"/>
The IDEA code analysis will tell me that "Attribute bar is not allowed here" even though it is perflectly fine when I compile it with the flex sdk.  It only seems to do this in components where its source is split like this.

Would it be better if I define a seperate 'flex module' over the same source directories?  I don't seem to have to define a flex libraries that way but it doesn't seem right somehow.

Message was edited by: Ronald Kinion

0
Comment actions Permalink

Flex sdk is for flex modules, flex sdk library for flex facet (the
content of former and latter is the same)
Could you please file JIRA request with exact sample of mxml / backed
action script in order to have IDEA handle this scenario?

Ronald Kinion wrote:

They are.

I came in this morning and now the syntax is more or less showing more or less correctly. The only thing I can think of is that IntelliJ needed to be restarted in order for it to read the libraries correctly. It would also be helpful if the the Help documentation on the flex facet explained what t
he flex sdk library option was and how it was to be used. I just assumed that even though I had defined a flex sdk, that when you define flex as a facet of a module you would still have to create a library and include it in your project plus refer to that library in this option.

I am still getting some false errors though. They seem to be on my custom components where the ActionScript is included through a seperate source file. For instance, if I have custom component Foo.mxml and a seperate script file Foo_script.as with var bar:String in it, when I try to bind to that v
ariable in mxml like this: "<Foo id="test" bar=""/>
Then IDEA code analysis will tell me that "Attribute bar is not allowed here" even though it is perflectly fine when I compile it with the flex compiler. It only seems to do this in components where its source is split like this.

Would it be better if I define a seperate 'flex module' over the same source directories? I don't seem to have to define a flex libraries that way but it doesn't seem right somehow.

---
Original message URL: http://www.jetbrains.net/devnet/message/5232103#5232103



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Guest wrote:

Flex sdk is for flex modules, flex sdk library for flex facet (the
content of former and latter is the same)
Could you please file JIRA request  with exact sample of mxml / backed
action script in order to have IDEA handle this scenario?


I was able to create a simple example of the problem.  Here is the Jira request I created: http://www.jetbrains.net/jira/browse/IDEA-21933

0
Comment actions Permalink

I am having this same problem.  Unfortunately, restarting IDEA is not solving it either.

I've messed with project settings for about fifteen minutes to no avail.

Reverted to 8.01 and everything's working again.

0

Please sign in to leave a comment.