Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Maxim Mossienko 
Subsystem
J2EE.JSP 
Affected versions
Fixed in
Fixed in build
Next build 
Build
4155
Fixed in build
4157
Severity
0
  • Submitted by   Serge Baranov
    4 years ago (07 Feb 2006 03:32)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:26)
  • Jira: IDEA-31279
    (history, comments)

IDEA-31279

JSP page context variables not auto-completing in IntelliJ 5.1

Brian Lenz reports:

I have included a sample webapp that is
experiencing this problem. Just take a look at test.jsp. The primary
problem I am talking about is exhibited by the first two g:set tags. The
pageContext attributes are not available for autocomplete, ctrl-click,
property reference, etc. in IntelliJ 5.1, though they worked just fine in
5.0.2.

Additionally, I included a bit of information about a separate issue with
IntelliJ 5.0.2 where IntelliJ wasn't honoring the scope of a variable
returned in the VariableInfo for the TagExtraInfo. IntelliJ 5.0.2 always
interpreted the variable as having an AT_END scope (and thus being available
for the remainder of the page), even if the variable had AT_NESTED scope (in
which case the variable should only be available within the start/end tags.

The first issue is a much more serious issue (from our perspective) than the
second, as the lack of autocomplete is quite inhibiting. I'm going to
downgrade to 5.0.2 until this issue can be resolved.

Environment: OS: Windows XP
JDK: JDK 1.5.0
IDEA: 5.1
Build: 4155

Issue was resolved
Comments (9)
 
History (1)
 
Links
 
Maxim Mossienko
  Maxim Mossienko
07 Feb 2006 15:07
(4 years ago)
#permalink
Second problem is not observed in 5.1
Brian Lenz
  Brian Lenz
07 Feb 2006 19:48
(4 years ago)
#permalink
Thanks for the prompt resolution to this problem. Is there any way for me to get build 4157 with the fix?

Also, I wanted to clarify the second issue. The problem is that all variables are being interpreted as AT_END, so even if you return VariableInfo with AT_BEGIN or AT_NESTED, IntelliJ won't recognize the variable for auto-completion until after the end of the tag. Thus, something like a for loop wouldn't work. e.g.:

<% assuming loopVar had returned VariableInfo with AT_NESTED specified %>
<g:forEach var="loopVar" className="foo.Foo">
<%-- loopVar should be in scope for auto-completion in IntelliJ right here with type foo.Foo --%>
</g:forEach>

<%-- in IntelliJ 5.0.2, the loopVar only was accessible for auto-completion at this point, which is clearly invalid since the variable is actually only available within the body of the g:forEach tag --%>

Does that clarify the issue? If it is fixed in 5.1, then that would be wonderful. There's no way for me to tell on build 4155 since it has the general auto-completion bug, but I can confirm that it is fixed if I can get my hands on 4157.

Thanks for your help,

Brian
Maxim Mossienko
  Maxim Mossienko
08 Feb 2006 17:16
(4 years ago)
#permalink
Hi,
In two weeks we will release 5.1.1 (most likely without eap) that will contain the fix.
I tried your custom tag giving it custom parameter and it completes inside as expected (so if the problem replays then please file another issue).
Brian Lenz
  Brian Lenz
08 Feb 2006 19:14
(4 years ago)
#permalink
OK, thanks for the info. I appreciate your help!
Brian Lenz
  Brian Lenz
09 Feb 2006 01:36
(4 years ago)
#permalink
There is one other related issue in 5.0.2 that I forgot to mention. Auto-completion doesn't work correctly when a property is parameterized with Java 1.5 generics. I have uploaded a new sample.zip showing the problem. See the generics.jsp file. Notice that typedMapEntry properly has its properties (key/value) auto-completed. The issue/bug here is that mapEntry does not have its properties properly auto-completed, despite the fact that it is parameterized to <T extends Map.Entry>. Map.Entry isn't the best example, but I chose it since it is simple and has a key and value property accessible via getters.

It would be GREAT if you could address this issue in the upcoming 5.1.1 release.

Please let me know if you'd like me to create separate bug issues for these types of problems. I figured that since it is pretty closely related to this issue that I could piggy-back.
Brian Lenz
  Brian Lenz
09 Feb 2006 01:46
(4 years ago)
#permalink
Additionally, it would be nice if IntelliJ could detect the proper class based on its parameterized type.

e.g.
class FooBean<T extends Foo> {
public T getFoo() {
return foo;
}
}

class Foo {
public getX() {
return x;
}
}

class Bar extends Foo {
public getY() {
return y;
}
}

class BarBean extends FooBean<Bar> {
}

Then, in JSP, do something like:

${barBean.foo.y}

where "barBean" is an instance of BarBean. Note that in this case, IntelliJ would detect that the "T" parameter in FooBean is of type Bar, and thus allows auto-completion of the "y" property of Bar.

Does that make sense? Let me know if you'd like a more explicit example (with sample project/code).
Maxim Mossienko
  Maxim Mossienko
09 Feb 2006 15:42
(4 years ago)
#permalink
Thank you for the feedback.
Please, open another issue(s) for the bugs you attached.
They will be fixed in Demetra release (only serious regression issues will be considered for 5.1.1 ).
Brian Lenz
  Brian Lenz
09 Feb 2006 19:48
(4 years ago)
#permalink
Thanks for the heads up, Maxim. I have created a new issue for the additional problems I described above:
IDEA-6695
Brian Lenz
  Brian Lenz
21 Mar 2006 20:48
(3 years ago)
#permalink
FYI, I tested this on the latest 5.1.1 EAP (4171), and the problem is fixed. Thanks!