mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 05:10:55 +00:00
idea: comment highlighting support
This commit is contained in:
@ -89,8 +89,13 @@ class PorkLexer : LexerBase() {
|
||||
PorkTokenTypes.Number
|
||||
token.type == TokenType.Whitespace ->
|
||||
PorkTokenTypes.Whitespace
|
||||
token.type == TokenType.BlockComment ->
|
||||
PorkTokenTypes.BlockComment
|
||||
token.type == TokenType.LineComment ->
|
||||
PorkTokenTypes.LineComment
|
||||
else -> PsiTokenType.CODE_FRAGMENT
|
||||
}
|
||||
|
||||
override fun toString(): String = "Lexer(start=$internalTokenStart, end=$internalTokenEnd)"
|
||||
override fun toString(): String =
|
||||
"PorkLexer(start=$internalTokenStart, end=$internalTokenEnd)"
|
||||
}
|
||||
|
@ -40,6 +40,16 @@ object PorkSyntaxHighlighter : SyntaxHighlighter {
|
||||
"PORK.NUMBER",
|
||||
DefaultLanguageHighlighterColors.NUMBER
|
||||
)
|
||||
PorkTokenTypes.BlockComment ->
|
||||
TextAttributesKey.createTextAttributesKey(
|
||||
"PORK.COMMENT.BLOCK",
|
||||
DefaultLanguageHighlighterColors.BLOCK_COMMENT
|
||||
)
|
||||
PorkTokenTypes.LineComment ->
|
||||
TextAttributesKey.createTextAttributesKey(
|
||||
"PORK.COMMENT.LINE",
|
||||
DefaultLanguageHighlighterColors.LINE_COMMENT
|
||||
)
|
||||
else -> null
|
||||
}
|
||||
return if (attributes == null)
|
||||
|
@ -10,4 +10,6 @@ object PorkTokenTypes {
|
||||
val Operator = IElementType("operator", PorkLanguage)
|
||||
val String = IElementType("string", PorkLanguage)
|
||||
val Number = IElementType("number", PorkLanguage)
|
||||
val BlockComment = IElementType("lineComment", PorkLanguage)
|
||||
val LineComment = IElementType("blockComment", PorkLanguage)
|
||||
}
|
||||
|
Reference in New Issue
Block a user