IDEA-104172 No possibility to define " as 'Block comment start' for custom file type

This commit is contained in:
peter
2013-05-07 18:17:05 +02:00
parent a43155d0f5
commit 9e2b92eab7
2 changed files with 12 additions and 5 deletions
@@ -62,14 +62,14 @@ public final class CustomFileTypeLexer extends AbstractCustomLexer {
ArrayList<TokenParser> tokenParsers = new ArrayList<TokenParser>();
tokenParsers.add(new WhitespaceParser());
tokenParsers.add(quotedStringParser);
tokenParsers.add(quotedStringParser2);
if (lineCommentParser != null) {
tokenParsers.add(lineCommentParser);
}
if (multilineCommentParser != null) {
tokenParsers.add(multilineCommentParser);
}
tokenParsers.add(quotedStringParser);
tokenParsers.add(quotedStringParser2);
tokenParsers.add(numberParser);
tokenParsers.add(new PunctuationParser());
if (hexNumberParser != null) {
@@ -15,12 +15,9 @@
* limitations under the License.
*/
package com.intellij.ide.highlighter.custom
import com.intellij.lexer.Lexer
import com.intellij.openapi.fileTypes.PlainTextSyntaxHighlighterFactory
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vcs.impl.CancellableRunnable
import com.intellij.psi.impl.DebugUtil
import com.intellij.testFramework.LexerTestCase
import com.intellij.testFramework.PlatformTestUtil
import com.intellij.util.ThrowableRunnable
@@ -334,6 +331,16 @@ KEYWORD_2 ('foo{}')
'''
}
public void "test quote block comment"() {
SyntaxTable table = new SyntaxTable()
table.startComment = '"'
table.endComment = 'x'
doTest table, '"axa', '''\
MULTI_LINE_COMMENT ('"ax')
IDENTIFIER ('a')
'''
}
public void testPlainText() {
doTest PlainTextSyntaxHighlighterFactory.createPlainTextLexer(), 'ab.@c (<def>)', '''\
CHARACTER ('ab.@c')