Skip to content

Commit

Permalink
style(Üintellij): some code reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
d-biehl committed Jan 4, 2025
1 parent 97081a5 commit 8eb9338
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 41 deletions.
1 change: 1 addition & 0 deletions intellij-client/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ org.gradle.caching = true


kotlin.daemon.jvmargs=-Xmx4096m
kotlin.code.style=official
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ private val PAIRS = arrayOf(
)

class RobotCodeBraceMatcher : PairedBraceMatcher {

override fun getPairs(): Array<BracePair> {
return PAIRS
}

override fun isPairedBracesAllowedBeforeType(lbraceType: IElementType, contextType: IElementType?): Boolean {
return true
}

override fun getCodeConstructStart(file: PsiFile?, openingBraceOffset: Int): Int {
return openingBraceOffset
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package dev.robotcode.robotcode4ij.execution
import com.intellij.execution.lineMarker.RunLineMarkerContributor
import com.intellij.icons.AllIcons
import com.intellij.psi.PsiElement
import com.intellij.psi.util.elementType
import dev.robotcode.robotcode4ij.psi.FILE
import dev.robotcode.robotcode4ij.psi.TESTCASE_NAME
import com.intellij.psi.util.elementType

class RobotCodeRunLineMarkerContributor : RunLineMarkerContributor() {
override fun getInfo(element: PsiElement): Info? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import dev.robotcode.robotcode4ij.psi.HEADER
import dev.robotcode.robotcode4ij.psi.KEYWORD_CALL
import dev.robotcode.robotcode4ij.psi.KEYWORD_NAME
import dev.robotcode.robotcode4ij.psi.OPERATOR
import dev.robotcode.robotcode4ij.psi.RobotTextMateElementType
import dev.robotcode.robotcode4ij.psi.SETTING
import dev.robotcode.robotcode4ij.psi.TESTCASE_NAME
import dev.robotcode.robotcode4ij.psi.VARIABLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,44 @@ class RobotTextMateHighlightingLexer : TextMateHighlightingLexer(
TextMateBundleHolder.descriptor, Registry.get("textmate.line.highlighting.limit").asInteger()
) {
companion object {
val mapping = mapOf(
"comment.line.robotframework" to COMMENT_LINE,
"comment.line.rest.robotframework" to COMMENT_LINE,
"comment.block.robotframework" to COMMENT_BLOCK,
"punctuation.definition.variable.begin.robotframework" to VARIABLE_BEGIN,
"punctuation.definition.variable.end.robotframework" to VARIABLE_END,
"punctuation.definition.envvar.begin.robotframework" to ENVIRONMENT_VARIABLE_BEGIN,
"punctuation.definition.envvar.end.robotframework" to ENVIRONMENT_VARIABLE_END,

"entity.name.function.testcase.name.robotframework" to TESTCASE_NAME,
"entity.name.function.keyword.name.robotframework" to KEYWORD_NAME,

"keyword.other.header.robotframework" to HEADER,
"keyword.other.header.settings.robotframework" to HEADER,
"keyword.other.header.variable.robotframework" to HEADER,
"keyword.other.header.testcase.robotframework" to HEADER,
"keyword.other.header.task.robotframework" to HEADER,
"keyword.other.header.keyword.robotframework" to HEADER,
"keyword.other.header.comment.robotframework" to HEADER,

"keyword.control.settings.robotframework" to SETTING,
"keyword.control.settings.documentation.robotframework" to SETTING,

"entity.name.function.keyword-call.robotframework" to KEYWORD_CALL,
"keyword.control.flow.robotframework" to CONTROL_FLOW,

"keyword.other.robotframework" to SETTING,

"variable.name.readwrite.robotframework" to VARIABLE,
"keyword.operator.robotframework" to OPERATOR,

"constant.character.robotframework" to ARGUMENT,
"string.unquoted.argument.robotframework" to ARGUMENT,

"keyword.operator.continue.robotframework" to CONTINUATION,
val mapping by lazy {
mapOf(
"comment.line.robotframework" to COMMENT_LINE,
"comment.line.rest.robotframework" to COMMENT_LINE,
"comment.block.robotframework" to COMMENT_BLOCK,
"punctuation.definition.variable.begin.robotframework" to VARIABLE_BEGIN,
"punctuation.definition.variable.end.robotframework" to VARIABLE_END,
"punctuation.definition.envvar.begin.robotframework" to ENVIRONMENT_VARIABLE_BEGIN,
"punctuation.definition.envvar.end.robotframework" to ENVIRONMENT_VARIABLE_END,

"entity.name.function.testcase.name.robotframework" to TESTCASE_NAME,
"entity.name.function.keyword.name.robotframework" to KEYWORD_NAME,

"keyword.other.header.robotframework" to HEADER,
"keyword.other.header.settings.robotframework" to HEADER,
"keyword.other.header.variable.robotframework" to HEADER,
"keyword.other.header.testcase.robotframework" to HEADER,
"keyword.other.header.task.robotframework" to HEADER,
"keyword.other.header.keyword.robotframework" to HEADER,
"keyword.other.header.comment.robotframework" to HEADER,

"keyword.control.settings.robotframework" to SETTING,
"keyword.control.settings.documentation.robotframework" to SETTING,

"entity.name.function.keyword-call.robotframework" to KEYWORD_CALL,
"keyword.control.flow.robotframework" to CONTROL_FLOW,

"keyword.other.robotframework" to SETTING,

"variable.name.readwrite.robotframework" to VARIABLE,
"keyword.operator.robotframework" to OPERATOR,

"constant.character.robotframework" to ARGUMENT,
"string.unquoted.argument.robotframework" to ARGUMENT,

"keyword.operator.continue.robotframework" to CONTINUATION,
)
}
}

override fun getTokenType(): IElementType? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.intellij.extapi.psi.PsiFileBase
import com.intellij.openapi.fileTypes.FileType
import com.intellij.psi.FileViewProvider
import dev.robotcode.robotcode4ij.RobotFrameworkLanguage
import dev.robotcode.robotcode4ij.RobotSuiteFileType
import dev.robotcode.robotcode4ij.RobotResourceFileType
import dev.robotcode.robotcode4ij.RobotSuiteFileType

class RobotSuiteFile(viewProvider: FileViewProvider) : PsiFileBase(
viewProvider,
Expand Down

0 comments on commit 8eb9338

Please sign in to comment.