Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Maxim Mossienko 
Subsystem
Editor. Code Completion 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7675
Fixed in build
8212
Subsystems
0, 0
Severity
0
  • Submitted by   Mike Hanafey
    23 months ago (21 Feb 2008 17:23)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:58)
  • Jira: IDEA-42973
    (history, comments)

IDEA-42973

Define external variable in comment annotation

0
When editing JSF views it is often necessary to use a comment annotation to reveal the type of a variable so that IDEA can do the very important code completion and navigation functions. This is often the case with 3rd party JSF components that do some kind of looping, and therefore define a local variable for the scope of the looping.

IDEA comment annotations seem to have no clue about scope. The example below illustrates the problems:

{code:xml}
<h:form id="Commentary">
<rich:tree id="CmtTree" var="citem" value="#{leadReport.lead.commentaryUiTree}" switchType="client"
nodeFace="#{citem.nodeFace}" adviseNodeOpened="#{leadReport.adviseNodeOpened}">
<@elvariable id="sitem" type="genomix.tractor.Lead.SequenceUi">
<rich:treeNode id="s" type="s" nodeClass="C-wrappingTreeNode">
<trak:sequence id="seqNode" lead="#{leadReport.lead}" seq="#{sitem}" reRender="Sequence:SeqTree"/>
</rich:treeNode>
<rich:treeNode id="es" type="es" nodeClass="C-wrappingTreeNode">
<trak:sequenceEditable id="seqEdNode" lead="#{leadReport.lead}" seq="#{sitem}" reRender="Sequence:SeqTree"/>
</rich:treeNode>
</rich:tree>
</h:form>
{code}

The two rich:tree components define local variable under the attribute "var", and these must artifically be given different names so that different comment annotations can be attached. Ideallly, a comment annotation would only apply to the element (including its attributes) it is contained in.

The EL nodeFace="#{citem.nodeFace}" is fully understood with the comment annotation, but value="#{citem.rootData}" is not understood. In the latter case navigation to its defintion leads you back to var="citem" of the rich:tree, but in the former case navigation is back to the comment annotation. It does not matter where the comment annotation is located. This makes no sense and appears to be just a bug.

Of course it is nice when no comment annotations are needed, but it is a much more serious problem when the annotations cannot be used to put brains in EL expressions.

Issue was resolved
Comments (1)
 
History (1)
 
Links
 
Mike Hanafey
  Mike Hanafey
21 Feb 2008 17:30
(23 months ago)
#permalink
Another problem is <!@elvariable id="citem" type="genomix.tractor.Lead.CommentUi"> refers to innier class CommentUi. IDEA does completion to fill in the "type" attribute, but then it does not allow navigation to CommentUi. All of the preceding terms can be navigated to, but CommentUi is dead.