From 0f8015fcaf01b271f8fd4ac4e3bd889c2e5c49ed Mon Sep 17 00:00:00 2001 From: Maxim Medvedev Date: Mon, 7 Feb 2011 15:14:40 +0300 Subject: [PATCH] IDEA-63490 TODO statement in javadocs is only recognized when //-commented TODO is present --- .../groovy/highlighter/GroovyTodoIndexer.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyTodoIndexer.java diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyTodoIndexer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyTodoIndexer.java new file mode 100644 index 000000000000..d781e5445d22 --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyTodoIndexer.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2011 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.plugins.groovy.highlighter; + +import com.intellij.lexer.FilterLexer; +import com.intellij.lexer.Lexer; +import com.intellij.psi.impl.cache.impl.todo.LexerBasedTodoIndexer; +import com.intellij.psi.impl.cache.impl.todo.TodoOccurrenceConsumer; +import org.jetbrains.plugins.groovy.lang.lexer.GroovyFilterLexer; +import org.jetbrains.plugins.groovy.lang.lexer.GroovyLexer; +import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes; + +/** + * @author Maxim.Medvedev + */ +public class GroovyTodoIndexer extends LexerBasedTodoIndexer { + @Override + protected Lexer createLexer(TodoOccurrenceConsumer consumer) { + final GroovyFilterLexer groovyFilterLexer = new GroovyFilterLexer(new GroovyLexer(), consumer); + return new FilterLexer(groovyFilterLexer, new FilterLexer.SetFilter(GroovyTokenTypes.WHITE_SPACES_OR_COMMENTS)); + } +}