WEB-6700 TODOs not recognized on multiple level language template

This commit is contained in:
Maxim.Mossienko
2013-12-24 17:51:26 +01:00
parent 4548db3b7c
commit 9d008109b5
3 changed files with 4 additions and 11 deletions
@@ -163,7 +163,7 @@ public abstract class PlatformIdTableBuilding {
highlighter = editorHighlighter;
}
else {
highlighter = HighlighterFactory.createHighlighter(null, myFile);
highlighter = HighlighterFactory.createHighlighter(inputData.getProject(), myFile);
highlighter.setText(chars);
}
@@ -131,7 +131,7 @@ public class TodoIndex extends FileBasedIndexExtension<TodoIndexEntry, Integer>
@Override
public int getVersion() {
return 5;
return 6;
}
@Override
@@ -29,6 +29,7 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.impl.cache.CacheUtil;
import com.intellij.psi.impl.cache.TodoCacheManager;
import com.intellij.psi.search.IndexPattern;
import com.intellij.psi.search.IndexPatternOccurrence;
@@ -187,15 +188,7 @@ public class IndexPatternSearcher implements QueryExecutor<IndexPatternOccurrenc
if (lexer.getTokenStart() >= range.getEndOffset()) break;
}
boolean isComment = commentTokens.contains(tokenType);
if (!isComment) {
final Language commentLang = tokenType.getLanguage();
final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(commentLang);
if (parserDefinition != null) {
final TokenSet langCommentTokens = parserDefinition.getCommentTokens();
isComment = langCommentTokens.contains(tokenType);
}
}
boolean isComment = commentTokens.contains(tokenType) || CacheUtil.isInComments(tokenType);
if (isComment) {
final int startDelta = builderForFile != null ? builderForFile.getCommentStartDelta(lexer.getTokenType()) : 0;