Autocompletion and class links do not work in JSP
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 13
### What happened
The Autocompletion and class links do not work in JSP-Files. The file is parsed and a ParseException is shown.
```
java.lang.IllegalStateException: Caller of TokenSequence forgot to call moveNext/Previous() or it returned false (no more tokens)
TokenSequence for text/x-jsp/text/x-java at tokenIndex=43. TokenList contains 43 tokens:
T[ 0]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[ 1]: "form" <3542,3546> IDENTIFIER[1] DefT, la=1, @22c1fb3c
T[ 2]: "." F(1) DOT[82] FlyT, la=1, @221a31cc
T[ 3]: "renderTest" <3547,3562> IDENTIFIER[1] DefT, la=1, @3f24b2ac
T[ 4]: "(" F(1) LPAREN[74] FlyT, @5b4eeb4c
T[ 5]: "iox" <3563,3566> IDENTIFIER[1] DefT, la=1, @76fbe302
T[ 6]: "," F(1) COMMA[81] FlyT, @51c3840
T[ 7]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[ 8]: "form" <3568,3572> IDENTIFIER[1] DefT, la=1, @1fb74b9d
T[ 9]: "." F(1) DOT[82] FlyT, la=1, @221a31cc
T[10]: "findCurrObject" <3573,3587> IDENTIFIER[1] DefT, la=1, @338fc7ac
T[11]: "(" F(1) LPAREN[74] FlyT, @5b4eeb4c
T[12]: "iox" <3588,3591> IDENTIFIER[1] DefT, la=1, @1a45c12c
T[13]: ")" F(1) RPAREN[75] FlyT, @7eff341c
T[14]: "," F(1) COMMA[81] FlyT, @51c3840
T[15]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[16]: "out" <3594,3597> IDENTIFIER[1] DefT, la=1, @5b3163fd
T[17]: "," F(1) COMMA[81] FlyT, @51c3840
T[18]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[19]: "xslParas" <3599,3607> IDENTIFIER[1] DefT, la=1, @164e6d90
T[20]: "," F(1) COMMA[81] FlyT, @51c3840
T[21]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[22]: "iox" <3609,3612> IDENTIFIER[1] DefT, la=1, @22b682d4
T[23]: "." F(1) DOT[82] FlyT, la=1, @221a31cc
T[24]: "isEditMode" <3613,3623> IDENTIFIER[1] DefT, la=1, @25ee1d4a
T[25]: "(" F(1) LPAREN[74] FlyT, @5b4eeb4c
T[26]: ")" F(1) RPAREN[75] FlyT, @7eff341c
T[27]: "," F(1) COMMA[81] FlyT, @51c3840
T[28]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[29]: "iox" <3627,3630> IDENTIFIER[1] DefT, la=1, @7590ac81
T[30]: "." F(1) DOT[82] FlyT, la=1, @221a31cc
T[31]: "isEditMode" <3631,3641> IDENTIFIER[1] DefT, la=1, @10d77d4e
T[32]: "(" F(1) LPAREN[74] FlyT, @5b4eeb4c
T[33]: ")" F(1) RPAREN[75] FlyT, @7eff341c
T[34]: "," F(1) COMMA[81] FlyT, @51c3840
T[35]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[36]: "true" F(4) TRUE[71] FlyT, la=1, @661eda2
T[37]: "," <3649,3650> COMMA[81] DefT, @53b0b469
T[38]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
T[39]: "myURL" <3651,3656> IDENTIFIER[1] DefT, la=1, @2334ee3a
T[40]: ")" F(1) RPAREN[75] FlyT, @7eff341c
T[41]: ";" F(1) SEMICOLON[80] FlyT, @822da1f
T[42]: " " F(1) WHITESPACE[124] FlyT, la=1, @38cf054
at org.netbeans.api.lexer.TokenSequence.checkTokenNotNull(TokenSequence.java:771)
at org.netbeans.api.lexer.TokenSequence.offset(TokenSequence.java:243)
at org.netbeans.modules.java.editor.base.semantic.TokenList$2.run(TokenList.java:123)
at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1402)
at org.netbeans.modules.java.editor.base.semantic.TokenList.moveToOffset(TokenList.java:90)
at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitIdentifier(SemanticHighlighterBase.java:761)
at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitIdentifier(SemanticHighlighterBase.java:270)
at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2592)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1006)
at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:270)
at com.sun.source.util.TreeScanner.visitMemberSelect(TreeScanner.java:819)
at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitMemberSelect(SemanticHighlighterBase.java:337)
at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitMemberSelect(SemanticHighlighterBase.java:270)
at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2458)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86)
....
....
[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
```
### How to reproduce
Open the jsp file and wait 3 seconds.
### Did this work correctly in an earlier version?
The code works with Netbeans 8.x
### Operating System
Windows
### JDK
8
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
_No response_
### Are you willing to submit a pull request?
No
### Code of Conduct
Yes
Contributor guide
Research direction
Reproduce the failure by opening the JSP file and waiting three seconds. Start with the reported TokenSequence.java, TokenList.java, and SemanticHighlighterBase stack frames, then trace the JSP parsing path. Done means JSP autocompletion and class links work without the reported ParseException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100