Skip to content

Commit

Permalink
style(intellij): reformat and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
d-biehl committed Dec 29, 2024
1 parent dcb20f7 commit 9415c3b
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ import com.intellij.psi.codeStyle.CodeStyleSettings
import com.intellij.psi.codeStyle.CustomCodeStyleSettings

class RobotCodeCodeStyleSettings(settings: CodeStyleSettings) :
CustomCodeStyleSettings("GdCodeStyleSettings", settings) {
}
CustomCodeStyleSettings("GdCodeStyleSettings", settings)
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RobotCodeLangCodeStyleSettingsProvider : LanguageCodeStyleSettingsProvider
}
}

override fun getCodeSample(settingsType: SettingsType): String? {
override fun getCodeSample(settingsType: SettingsType): String {
return "*** Settings ***\n" +
"Library SeleniumLibrary\n" +
"\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.intellij.psi.tree.TokenSet
import org.jetbrains.plugins.textmate.TextMateService
import org.jetbrains.plugins.textmate.language.syntax.lexer.TextMateHighlightingLexer

val FILE = IStubFileElementType<PsiFileStub<RobotFile>>("RobotSuiteFile", RobotFrameworkLanguage);
val FILE = IStubFileElementType<PsiFileStub<RobotFile>>("RobotSuiteFile", RobotFrameworkLanguage)

class RobotCodeParserDefinition : ParserDefinition {

Expand Down Expand Up @@ -81,6 +81,4 @@ class RobotPsiParser : PsiParser {
}
}

class RobotPsiElement(type: IElementType) : CompositePsiElement(type) {

}
class RobotPsiElement(type: IElementType) : CompositePsiElement(type)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import com.intellij.execution.configurations.ConfigurationTypeBase
class RobotCodeRunConfiguration :
ConfigurationTypeBase("robotcode", "RobotCode", "Run Robot Framework Tests", RobotIcons.RobotCode) {
init {
addFactory(RobotCodeRunConfigurationFactory(this));
addFactory(RobotCodeRunConfigurationFactory(this))
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.robotcode.robotcode4ij

import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationFactory
import com.intellij.execution.configurations.ConfigurationType
import com.intellij.execution.configurations.RunConfiguration
import com.intellij.openapi.project.Project
Expand All @@ -16,6 +16,6 @@ class RobotCodeRunConfigurationFactory(type: ConfigurationType) : ConfigurationF
}

override fun getIcon(): Icon? {
return RobotIcons.RobotCode;
return RobotIcons.RobotCode
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ private fun getBundles(): List<TextMateBundleProvider.PluginBundle> {
class RobotCodeTextMateBundleProvider : TextMateBundleProvider {

override fun getBundles(): List<TextMateBundleProvider.PluginBundle> {
return robotCodeBundle;
return robotCodeBundle
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package dev.robotcode.robotcode4ij
import com.intellij.openapi.util.IconLoader
import javax.swing.Icon

public class RobotIcons {
class RobotIcons {
companion object {
val Resource: Icon? = IconLoader.findIcon("/images/robot.svg", RobotIcons.Companion::class.java);
val Suite: Icon? = IconLoader.findIcon("/images/robot.svg", RobotIcons.Companion::class.java);
val RobotCode: Icon? = IconLoader.findIcon("/images/robotcode.svg", RobotIcons.Companion::class.java);
val Resource: Icon? = IconLoader.findIcon("/images/robot.svg", Companion::class.java)
val Suite: Icon? = IconLoader.findIcon("/images/robot.svg", Companion::class.java)
val RobotCode: Icon? = IconLoader.findIcon("/images/robotcode.svg", Companion::class.java)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.intellij.openapi.fileTypes.LanguageFileType
import com.intellij.openapi.fileTypes.OSFileIdeAssociation

object RobotResourceFileType : LanguageFileType(RobotFrameworkLanguage), OSFileIdeAssociation {
override fun getName() = "ROBOT_FRAMEWORK_RESOURCE";
override fun getDisplayName() = "Robot Framework Resource";
override fun getDescription() = "Robot Framework resource files";
override fun getName() = "ROBOT_FRAMEWORK_RESOURCE"
override fun getDisplayName() = "Robot Framework Resource"
override fun getDescription() = "Robot Framework resource files"
override fun getDefaultExtension() = "robot"
override fun getIcon() = RobotIcons.Resource
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.intellij.openapi.fileTypes.LanguageFileType
import com.intellij.openapi.fileTypes.OSFileIdeAssociation

object RobotSuiteFileType : LanguageFileType(RobotFrameworkLanguage), OSFileIdeAssociation {
override fun getName() = "ROBOT_FRAMEWORK_SUITE";
override fun getDisplayName() = "Robot Framework Suite";
override fun getDescription() = "Robot Framework suite files";
override fun getName() = "ROBOT_FRAMEWORK_SUITE"
override fun getDisplayName() = "Robot Framework Suite"
override fun getDescription() = "Robot Framework suite files"
override fun getDefaultExtension() = "robot"
override fun getIcon() = RobotIcons.Suite
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RobotCodeLanguageClient(project: Project?) : IndexAwareLanguageClient(proj

override fun handleServerStatusChanged(serverStatus: ServerStatus?) {
if (serverStatus == ServerStatus.started) {
triggerChangeConfiguration();
triggerChangeConfiguration()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RobotCodeLanguageServer(private val project: Project) : OSProcessStreamCon
}

private fun buildCommandLine(port: Int = 6610): GeneralCommandLine {
val pythonInterpreter = project.pythonSdk?.homePath;
val pythonInterpreter = project.pythonSdk?.homePath
if (pythonInterpreter != null) {
return GeneralCommandLine(
pythonInterpreter, "-u", "-X", "utf8",
Expand Down Expand Up @@ -69,7 +69,7 @@ class RobotCodeLanguageServer(private val project: Project) : OSProcessStreamCon
clientSocket!!.close()
clientSocket = null
serverSocket!!.close()
serverSocket = null;
serverSocket = null

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class RobotCodeLanguageServerFactory : LanguageServerFactory, LanguageServerEnab
return RobotCodeLanguageClient(project)
}

override fun getServerInterface(): Class<out LanguageServer> {
return super.getServerInterface()
}

override fun isEnabled(project: Project): Boolean {
if (project.getUserData(ENABLED_KEY) == true) {
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RobotCodeLanguageServerManager(private val project: Project) {
)
if (res.exitCode != 0 || res.stdout.trim() != "True") {
thisLogger().warn("Invalid python version")
return false;
return false
}

val res1 = ExecUtil.execAndGetOutput(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class ProjectSettingsConfigurableProvider(private val project: Project) : Config
return ProjectSettingsConfigurable(project)
}

override fun canCreateConfigurable(): Boolean {
return super.canCreateConfigurable()
}
}


Expand Down Expand Up @@ -96,14 +93,14 @@ class ProjectSettings : SimplePersistentStateComponent<ProjectSettings.ProjectSt
}

fun asJson(): JsonElement {
val builder = GsonBuilder().serializeNulls().setPrettyPrinting().create();
val builder = GsonBuilder().serializeNulls().setPrettyPrinting().create()

val robotSettings = RobotCodeSettings()
robotSettings.robotcode.inlayHints.parameterNames = state.inlayHintsParameterNames
robotSettings.robotcode.inlayHints.namespaces = state.inlayHintsNamespaces

val json = builder.toJsonTree(robotSettings)
return json;
return json
}

class ProjectState : BaseState() {
Expand Down
6 changes: 3 additions & 3 deletions intellij-client/src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions intellij-client/src/main/resources/images/robot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions intellij-client/src/main/resources/images/robotcode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9415c3b

Please sign in to comment.