mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-104172 No possibility to define " as 'Block comment start' for custom file type
This commit is contained in:
+2
-2
@@ -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) {
|
||||
|
||||
+10
-3
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user