This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 153047 - no replacement for SyntaxUpdateTokens
Summary: no replacement for SyntaxUpdateTokens
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks: 152639
  Show dependency tree
 
Reported: 2008-11-12 15:10 UTC by Vladimir Voskresensky
Modified: 2009-02-19 20:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2008-11-12 15:10:54 UTC
SyntaxUpdateTokens is working on deprecated syntax support infrastructure (and use TokenID class) => we don't have
possibility to support custom code folding if remove our legacy C++ syntax support (see CCKit.initDocument)
Comment 1 Vladimir Voskresensky 2008-11-12 16:06:56 UTC
In fact, we don't need the exact replacement. As general solution code folding infrastructure could analyze itself all
tokens LINE_COMMENT in document and extract needed codefolding tags text (like <editor-fold>/</editor-fold>)
Or ask editor kits to do something like:
doc.putProperty("folding-tokens", EnumSet.of(CppTokenId.LINE_COMMENT));
then you can use set of dedicated tokens to analyze it's content for folding tags
Comment 2 Vitezslav Stejskal 2008-11-14 09:32:58 UTC
I'm not sure if I understand it. Since 6.5 CustomFoldManager works with lexer tokens rather then with the old Syntax
tokens. It automatically scans all tokens that belong to a primary category called "comment". I don't know off hand what
tokens and categories are produced by C++ lexer, but custom code folds should work automagically in any language that
creates its comment tokens under the "comment" primary category.

Is this the missing piece of information that you needed or did I misunderstand the problem? Thanks
Comment 3 Vladimir Voskresensky 2008-11-14 16:39:17 UTC
I have checked your statement and  all needed is realy already in place (we have "comment" category for comment tokens
as well). Great! 

We had to add syntax based approach in the beginning of 6.5 (or even 6.1), but wasn't aware that it was added in editor
in 6.5 later on