History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-4510
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Serge Baranov
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

JSP page context variables not auto-completing in IntelliJ 5.1

Created: 07 Feb 06 03:32   Updated: 21 Mar 06 20:48
Component/s: J2EE.JSP
Fix Version/s: 5.1.1, Demetra 5162

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Zip Archive sample.zip (12 kb)
2. Zip Archive sample.zip (11 kb)

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

Build: 4,155
Fixed in build: 4,157
Severity: High


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
Maxim Mossienko - 07 Feb 06 15:07
Second problem is not observed in 5.1

Brian Lenz - 07 Feb 06 19:48
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 - 08 Feb 06 17:16
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 - 08 Feb 06 19:14
OK, thanks for the info. I appreciate your help!

Brian Lenz - 09 Feb 06 01:36
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 - 09 Feb 06 01:46
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 - 09 Feb 06 15:42
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 - 09 Feb 06 19:48
Thanks for the heads up, Maxim. I have created a new issue for the additional problems I described above:
IDEA-6695

Brian Lenz - 21 Mar 06 20:48
FYI, I tested this on the latest 5.1.1 EAP (4171), and the problem is fixed. Thanks!