rostanek / freemarker-support-for-netbeans

FreeMarker support for NetBeans including syntax coloring, parsing etc. new features will be added soon.
GNU General Public License v3.0
19 stars 7 forks source link

HTML code completion is broken #12

Open Chris2011 opened 8 years ago

Chris2011 commented 8 years ago

When I type < or <d I expect that the code completion for html AND ftl comes up but ftl code completions only comes up after hit <# which is ok, but hitting < shows me nothing. After ctrl + space it still shows me nothing.

rostanek commented 8 years ago

This is because HTML is embedded language and code completion for embedded language does not work out of the box. I haven't found a way how to integrate that since I started developing this plugin...

Chris2011 commented 8 years ago

Maybe you can communicate with Geertjan, he will find a way. :)

Chris2011 commented 8 years ago

Please have a look at the SilverStripe Plugin, which gives syntax highlighting inside .ss files for the SilverStripe templating engine. There you can figure out, how handled the problem, because in the .ss files we have the normal code completion for html. https://github.com/guru-digital/sstemplate-netbeans

Chris2011 commented 8 years ago

Maybe it is helpful?

rostanek commented 8 years ago

Thanks, I will study that in my free time.

zp1ke commented 8 years ago

got this stacktrace:

java.lang.IllegalStateException: Lexer org.netbeans.freemarker.lexer.FTLLexer@5d78e169 returned null token but lexerInput.readLength()=13 lexer-state: null tokenStartOffset=64747, readOffset=64760, lookaheadOffset=64761 Chars: ">\n</#macro>\n\n" - these characters need to be tokenized. Fix the lexer to not return null token in this state. at org.netbeans.lib.lexer.LexerInputOperation.checkLexerInputFinished(LexerInputOperation.java:457) at org.netbeans.lib.lexer.LexerInputOperation.nextToken(LexerInputOperation.java:217) at org.netbeans.lib.lexer.inc.IncTokenList.tokenOrEmbeddingImpl(IncTokenList.java:195) at org.netbeans.lib.lexer.inc.IncTokenList.tokenCount(IncTokenList.java:152) at org.netbeans.lib.lexer.TokenListList.scanTokenList(TokenListList.java:149) at org.netbeans.lib.lexer.TokenListList.<init>(TokenListList.java:128) at org.netbeans.lib.lexer.TokenHierarchyOperation.tokenListList(TokenHierarchyOperation.java:498) at org.netbeans.lib.lexer.EmbeddingOperation.embeddedTokenList(EmbeddingOperation.java:197) at org.netbeans.api.lexer.TokenSequence.embeddedImpl(TokenSequence.java:372) at org.netbeans.api.lexer.TokenSequence.embedded(TokenSequence.java:320) at org.netbeans.modules.editor.lib2.highlighting.SyntaxHighlighting$HSImpl.moveTheSequence(SyntaxHighlighting.java:449) at org.netbeans.modules.editor.lib2.highlighting.SyntaxHighlighting$HSImpl.moveNext(SyntaxHighlighting.java:427) at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$Wrapper.fetchNextHighlight(DirectMergeContainer.java:453) at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$HlSequence.updateMergeVars(DirectMergeContainer.java:305) at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$HlSequence.nextMerge(DirectMergeContainer.java:277) at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$HlSequence.moveNext(DirectMergeContainer.java:224) at org.netbeans.modules.editor.lib2.highlighting.HighlightsReader.readUntil(HighlightsReader.java:77) at org.netbeans.modules.editor.lib2.view.HighlightsViewFactory.restart(HighlightsViewFactory.java:191) at org.netbeans.modules.editor.lib2.view.ViewBuilder$FactoryState.init(ViewBuilder.java:1324) at org.netbeans.modules.editor.lib2.view.ViewBuilder.createViews(ViewBuilder.java:724) at org.netbeans.modules.editor.lib2.view.ViewBuilder.createReplaceRepaintViews(ViewBuilder.java:685) at org.netbeans.modules.editor.lib2.view.ViewUpdates.initParagraphs(ViewUpdates.java:231) at org.netbeans.modules.editor.lib2.view.DocumentViewOp.initParagraphs(DocumentViewOp.java:655) at org.netbeans.modules.editor.lib2.view.DocumentViewChildren.ensureParagraphsChildrenAndLayoutValid(DocumentViewChildren.java:537) at org.netbeans.modules.editor.lib2.view.DocumentViewChildren.ensureParagraphViewChildrenValid(DocumentViewChildren.java:293) at org.netbeans.modules.editor.lib2.view.DocumentViewChildren.viewToModelChecked(DocumentViewChildren.java:341) at org.netbeans.modules.editor.lib2.view.DocumentView.viewToModelNeedsLock(DocumentView.java:844) at org.netbeans.modules.editor.lib2.view.DocumentView.viewToModelChecked(DocumentView.java:831) at org.netbeans.modules.editor.lib2.view.EditorView.viewToModel(EditorView.java:341) at javax.swing.plaf.basic.BasicTextUI$RootView.viewToModel(BasicTextUI.java:1552) at javax.swing.plaf.basic.BasicTextUI.viewToModel(BasicTextUI.java:1101) at javax.swing.plaf.basic.BasicTextUI.viewToModel(BasicTextUI.java:1074) at org.netbeans.editor.BaseTextUI.viewToModel(BaseTextUI.java:319) at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar.getPaintInfo(CodeFoldingSideBar.java:488) at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar.paintComponent(CodeFoldingSideBar.java:1040) at javax.swing.JComponent.paint(JComponent.java:1056) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JViewport.paint(JViewport.java:728) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JLayer.paint(JLayer.java:433) at javax.swing.plaf.LayerUI.paint(LayerUI.java:79) at org.netbeans.core.multiview.SplitLayerUI.paint(SplitLayerUI.java:157) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at javax.swing.JComponent.paintComponent(JComponent.java:780) at javax.swing.JLayer.paint(JLayer.java:428) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at org.netbeans.swing.tabcontrol.TabbedContainer.paint(TabbedContainer.java:994) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) at javax.swing.RepaintManager.paint(RepaintManager.java:1272) at javax.swing.JComponent._paintImmediately(JComponent.java:5158) at javax.swing.JComponent.paintImmediately(JComponent.java:4969) at javax.swing.RepaintManager$4.run(RepaintManager.java:831) at javax.swing.RepaintManager$4.run(RepaintManager.java:814) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789) at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738) at javax.swing.RepaintManager.access$1200(RepaintManager.java:64) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java..

rostanek commented 8 years ago

Please create a new issue and attach ftl file related to this stacktrace.

Chris2011 commented 7 years ago

Can someone give the PR from @pedrohidalgo a try?