Skip to content

Commit b88aaf5

Browse files
committed
Rename comment roles to match intellij names
1 parent 9251a4d commit b88aaf5

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

src/main/gen/io/runescript/plugin/lang/lexer/_RsLexer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ else if (zzAtEOF) {
655655
switch (zzLexicalState) {
656656
case BLOCK_COMMENT: {
657657
popState();
658-
return MULTI_LINE_COMMENT;
658+
return BLOCK_COMMENT;
659659
} // fall though
660660
case 133: break;
661661
default:
@@ -886,12 +886,12 @@ else if (zzAtEOF) {
886886
case 86: break;
887887
case 37:
888888
{ popState();
889-
return MULTI_LINE_COMMENT;
889+
return BLOCK_COMMENT;
890890
}
891891
// fall through
892892
case 87: break;
893893
case 38:
894-
{ return SINGLE_LINE_COMMENT;
894+
{ return LINE_COMMENT;
895895
}
896896
// fall through
897897
case 88: break;
@@ -901,7 +901,7 @@ else if (zzAtEOF) {
901901
// fall through
902902
case 89: break;
903903
case 40:
904-
{ return MULTI_LINE_COMMENT;
904+
{ return BLOCK_COMMENT;
905905
}
906906
// fall through
907907
case 90: break;

src/main/grammars/RuneScript.flex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,22 @@ INCOMPLETE_TAG = "<"(shad|col|str|u|img)"="
6565
<BLOCK_COMMENT> {
6666
"*/" {
6767
popState();
68-
return MULTI_LINE_COMMENT;
68+
return BLOCK_COMMENT;
6969
}
7070
<<EOF>> {
7171
popState();
72-
return MULTI_LINE_COMMENT;
72+
return BLOCK_COMMENT;
7373
}
7474
[\s\S] { }
7575
}
7676

7777
<YYINITIAL,STRING_INTERPOLATION> {
7878

7979
// Comments
80-
"/**/" { return MULTI_LINE_COMMENT; }
80+
"/**/" { return BLOCK_COMMENT; }
8181
"/*" { pushState(BLOCK_COMMENT); }
8282

83-
{LINE_COMMENT} { return SINGLE_LINE_COMMENT; }
83+
{LINE_COMMENT} { return LINE_COMMENT; }
8484
// Keywords
8585
"if" { return IF; }
8686
"else" { return ELSE; }

src/main/kotlin/io/runescript/plugin/ide/RsCommenter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ class RsCommenter : CodeDocumentationAwareCommenter {
2828
}
2929

3030
override fun getLineCommentTokenType(): IElementType {
31-
return RsTokenTypes.SINGLE_LINE_COMMENT
31+
return RsTokenTypes.LINE_COMMENT
3232
}
3333

3434
override fun getBlockCommentTokenType(): IElementType {
35-
return RsTokenTypes.MULTI_LINE_COMMENT
35+
return RsTokenTypes.BLOCK_COMMENT
3636
}
3737

3838
override fun getDocumentationCommentTokenType(): IElementType? {

src/main/kotlin/io/runescript/plugin/ide/folding/RsFoldingBuilder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RsFoldingBuilder : FoldingBuilderEx(), DumbAware {
4242
}
4343

4444
is PsiComment -> {
45-
if (element.tokenType == RsTokenTypes.MULTI_LINE_COMMENT && !element.textRange.isEmpty) {
45+
if (element.tokenType == RsTokenTypes.BLOCK_COMMENT && !element.textRange.isEmpty) {
4646
descriptors.add(FoldingDescriptor(element.node, element.textRange))
4747
}
4848
}
@@ -57,7 +57,7 @@ class RsFoldingBuilder : FoldingBuilderEx(), DumbAware {
5757
return "{...}"
5858
}
5959

60-
RsTokenTypes.MULTI_LINE_COMMENT -> {
60+
RsTokenTypes.BLOCK_COMMENT -> {
6161
val whiteSpace = node.text.indexOfFirst { !Character.isWhitespace(it) && it != '/' && it != '*' }
6262
val newLineIndex = node.text.indexOf('\n', whiteSpace).let { if (it == -1) node.text.length else it }
6363
if (whiteSpace == -1 || newLineIndex < 1) {

src/main/kotlin/io/runescript/plugin/ide/formatter/lineIndent/RsLineIndentProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class RsLineIndentProvider : JavaLikeLangLineIndentProvider() {
4848
RsElementTypes.DEFAULT to SwitchDefault,
4949
RsElementTypes.ELSE to ElseKeyword,
5050
RsElementTypes.IF to IfKeyword,
51-
RsTokenTypes.MULTI_LINE_COMMENT to BlockComment,
52-
RsTokenTypes.SINGLE_LINE_COMMENT to LineComment,
51+
RsTokenTypes.BLOCK_COMMENT to BlockComment,
52+
RsTokenTypes.LINE_COMMENT to LineComment,
5353
RsElementTypes.COMMA to Comma
5454
)
5555
}

src/main/kotlin/io/runescript/plugin/ide/highlight/RsSyntaxHighlighter.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import com.intellij.psi.tree.TokenSet
88
import io.runescript.plugin.lang.lexer.RsLexerAdapter
99
import io.runescript.plugin.lang.lexer.RsLexerInfo
1010
import io.runescript.plugin.lang.psi.RsElementTypes.*
11-
import io.runescript.plugin.lang.psi.RsTokenTypes.MULTI_LINE_COMMENT
12-
import io.runescript.plugin.lang.psi.RsTokenTypes.SINGLE_LINE_COMMENT
11+
import io.runescript.plugin.lang.psi.RsTokenTypes.BLOCK_COMMENT
12+
import io.runescript.plugin.lang.psi.RsTokenTypes.LINE_COMMENT
1313
import io.runescript.plugin.lang.psi.RsTokenTypesSets.BRACES
1414
import io.runescript.plugin.lang.psi.RsTokenTypesSets.BRACKETS
1515
import io.runescript.plugin.lang.psi.RsTokenTypesSets.KEYWORDS
@@ -37,8 +37,8 @@ class RsSyntaxHighlighter(private val lexerInfo: RsLexerInfo) : SyntaxHighlighte
3737
attributes[ARRAY_TYPE_LITERAL] = RsSyntaxHighlighterColors.ARRAY_TYPE_LITERAL
3838
fillMap(attributes, TokenSet.create(STRING_START, STRING_PART, STRING_END), RsSyntaxHighlighterColors.STRING)
3939
attributes[STRING_TAG] = RsSyntaxHighlighterColors.STRING_TAG
40-
attributes[MULTI_LINE_COMMENT] = RsSyntaxHighlighterColors.BLOCK_COMMENT
41-
attributes[SINGLE_LINE_COMMENT] = RsSyntaxHighlighterColors.LINE_COMMENT
40+
attributes[BLOCK_COMMENT] = RsSyntaxHighlighterColors.BLOCK_COMMENT
41+
attributes[LINE_COMMENT] = RsSyntaxHighlighterColors.LINE_COMMENT
4242
fillMap(attributes, OPERATORS, RsSyntaxHighlighterColors.OPERATION_SIGN)
4343
fillMap(attributes, BRACES, RsSyntaxHighlighterColors.BRACES)
4444
attributes[SEMICOLON] = RsSyntaxHighlighterColors.SEMICOLON

src/main/kotlin/io/runescript/plugin/lang/psi/RsTokenTypes.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.runescript.plugin.lang.psi
22

33
object RsTokenTypes {
44
@JvmField
5-
val SINGLE_LINE_COMMENT = RsElementType("SINGLE_LINE_COMMENT")
5+
val LINE_COMMENT = RsElementType("LINE_COMMENT")
66
@JvmField
7-
val MULTI_LINE_COMMENT = RsElementType("MULTI_LINE_COMMENT")
7+
val BLOCK_COMMENT = RsElementType("BLOCK_COMMENT")
88
}

src/main/kotlin/io/runescript/plugin/lang/psi/RsTokenTypesSets.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package io.runescript.plugin.lang.psi
22

33
import com.intellij.psi.tree.TokenSet
44
import io.runescript.plugin.lang.psi.RsElementTypes.*
5-
import io.runescript.plugin.lang.psi.RsTokenTypes.MULTI_LINE_COMMENT
6-
import io.runescript.plugin.lang.psi.RsTokenTypes.SINGLE_LINE_COMMENT
5+
import io.runescript.plugin.lang.psi.RsTokenTypes.BLOCK_COMMENT
6+
import io.runescript.plugin.lang.psi.RsTokenTypes.LINE_COMMENT
77

88
object RsTokenTypesSets {
99

@@ -50,8 +50,8 @@ object RsTokenTypesSets {
5050
RPAREN,
5151
)
5252
val COMMENTS = TokenSet.create(
53-
SINGLE_LINE_COMMENT,
54-
MULTI_LINE_COMMENT,
53+
LINE_COMMENT,
54+
BLOCK_COMMENT,
5555
)
5656

5757
val STRING_ELEMENTS = TokenSet.create(STRING_START, STRING_PART, STRING_TAG, STRING_END)

0 commit comments

Comments
 (0)