How to make idea aware of TODOs within custom language

The todo’s within comments for my custom language do not seem to be taken in consideration by the IDE. Is there something I have to implement in addition to ParserDefinition.getCommentTokens()?

3 comments
Comment actions Permalink

The api documentation states "The To Do view is supported automatically if the plugin provides a correct implementation of the ParserDefinition.getCommentTokens() method.".
As far as my language parser is concerned, it implements this method. Looking at the parsed file with PsiViewer, it even shows the comments as PsiComment elements. So this may be a bug within the IDE. Or can it be that I need to somehow register my language for the TODO management?

0
Comment actions Permalink

Have identified the issue myself. I am using a two lexer strategy for highlighting and for parsing, each one working on different sets of token types.
The ParserDefinition.getCommentTokens() seems to be needing the highlighter tokens and not the parser tokens as I was expecting.
The solution is to use shared token types (among the parser and highlighter lexer) wherever possible.

0
Comment actions Permalink

Another usage of ParserDefinition.getCommentTokens() is that the PsiBuilder will skip those tokens automatically.

0

Please sign in to leave a comment.