final int lineStartOffset = myDocument.getLineStartOffset(myLineNumber);
final int lineEndOffset = lineStartOffset < myDocument.getTextLength() ? myDocument.getLineEndOffset(myLineNumber):0;
final FileType fileType = myElement.getContainingFile().getFileType();
SyntaxHighlighter highlighter = fileType.getHighlighter(myElement.getProject(), myElement.getContainingFile().getVirtualFile());
if (highlighter == null) {
highlighter = new PlainSyntaxHighlighter();
}
return createTextChunks(myDocument.getCharsSequence(), highlighter, lineStartOffset, lineEndOffset);
}