Skip to content

Commit

Permalink
chore: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Roboroads committed Dec 13, 2022
1 parent d94588c commit e7fe2b6
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import com.intellij.icons.AllIcons.RunConfigurations.TestState.Run
import com.intellij.openapi.editor.markup.GutterIconRenderer.Alignment.RIGHT
import com.intellij.psi.PsiElement
import com.intellij.psi.util.elementType
import java.awt.event.MouseEvent
import nl.deschepers.laraveltinker.Strings
import nl.deschepers.laraveltinker.util.TinkerConsoleUtil
import java.awt.event.MouseEvent

class TinkerRunLineMarkerProvider : LineMarkerProvider {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import nl.deschepers.laraveltinker.settings.GlobalSettingsState
import nl.deschepers.laraveltinker.toolwindow.TinkerOutputToolWindowFactory
import nl.deschepers.laraveltinker.util.PlugUtil


class PhpProcessListener(private val project: Project) :
ProcessListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import com.intellij.ui.IdeBorderFactory
import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.components.JBLabel
import com.intellij.util.ui.FormBuilder
import javax.swing.JPanel
import javax.swing.JTextField
import nl.deschepers.laraveltinker.Strings
import nl.deschepers.laraveltinker.util.PlugUtil.SUPPORT_MESSAGE_EXECUTIONS
import javax.swing.JPanel
import javax.swing.JTextField

class GlobalSettingsComponent {
private var settingsPanel: JPanel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.deschepers.laraveltinker.settings

import com.intellij.openapi.options.Configurable
import javax.swing.JComponent
import nl.deschepers.laraveltinker.Strings
import javax.swing.JComponent

class GlobalSettingsConfigurable : Configurable {
private var appSettingsComponent: GlobalSettingsComponent? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.util.xmlb.XmlSerializerUtil
import org.jetbrains.annotations.NotNull

@State(
name = "org.intellij.sdk.settings.AppSettingsState",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import com.intellij.ui.IdeBorderFactory
import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.components.JBLabel
import com.intellij.util.ui.FormBuilder
import javax.swing.JPanel
import nl.deschepers.laraveltinker.Strings
import javax.swing.JPanel

class ProjectSettingsComponent {
private var settingsPanel: JPanel
Expand All @@ -32,7 +32,6 @@ class ProjectSettingsComponent {
this.terminateAppCheckBox.isSelected = value
}


init {
laravelRootTextField.addBrowseFolderListener(
TextBrowseFolderListener(FileChooserDescriptorFactory.createSingleFolderDescriptor())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package nl.deschepers.laraveltinker.settings

import com.intellij.openapi.options.Configurable
import com.intellij.openapi.project.Project
import javax.swing.JComponent
import nl.deschepers.laraveltinker.Strings
import javax.swing.JComponent

class ProjectSettingsConfigurable(private var project: Project) : Configurable {
private var projectSettingsComponent: ProjectSettingsComponent? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.deschepers.laraveltinker.startup.migrations

import com.intellij.ide.scratch.ScratchFileService
import java.io.File
import nl.deschepers.laraveltinker.util.LaravelTinkerConsolesRootType
import java.io.File

class MakeSureConsolesHaveExtensions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import com.intellij.openapi.vfs.VfsUtil
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.ui.UIBundle
import com.jetbrains.php.lang.PhpLanguage
import nl.deschepers.laraveltinker.Strings
import java.io.IOException
import javax.swing.Icon
import nl.deschepers.laraveltinker.Strings

/**
* Most content is copied from ScratchRootType - but that class is final so I can't extend it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ import com.jetbrains.php.config.commandLine.PhpCommandSettingsBuilder
import com.jetbrains.php.run.PhpEditInterpreterExecutionException
import com.jetbrains.php.run.script.PhpScriptRunConfiguration
import com.jetbrains.php.run.script.PhpScriptRuntimeConfigurationProducer
import java.io.BufferedReader
import java.io.File
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
import java.util.stream.Collectors
import nl.deschepers.laraveltinker.Strings
import nl.deschepers.laraveltinker.balloon.LaravelRootDoesNotExistBalloon
import nl.deschepers.laraveltinker.balloon.VendorFolderNotFound
import nl.deschepers.laraveltinker.balloon.NoPhpInterpreterBalloon
import nl.deschepers.laraveltinker.balloon.PhpInterpreterErrorBalloon
import nl.deschepers.laraveltinker.balloon.VendorFolderNotFound
import nl.deschepers.laraveltinker.listener.PhpProcessListener
import nl.deschepers.laraveltinker.settings.ProjectSettingsState
import nl.deschepers.laraveltinker.toolwindow.TinkerOutputToolWindowFactory
import java.io.BufferedReader
import java.io.File
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
import java.util.stream.Collectors

class PhpArtisanTinkerUtil(private val project: Project, private val phpCode: String) {
fun run() {
Expand Down Expand Up @@ -68,7 +68,7 @@ class PhpArtisanTinkerUtil(private val project: Project, private val phpCode: St

// Check if the vendor path exists
var vendorPath = projectSettings.vendorRoot.ifEmpty { laravelRoot }
if(!vendorPath.endsWith("/vendor")) {
if (!vendorPath.endsWith("/vendor")) {
vendorPath = "$vendorPath/vendor"
}
val vendorDir = File(vendorPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object PlugUtil {
SUPPORT_MESSAGE_EXECUTIONS
) {
PersistentApplicationCache.instance.state.executionsCount = 0
val plugType = listOf("patreon","paypal","kofi","linktree","colleagues").asSequence().shuffled().find{true}
val plugType = listOf("patreon", "paypal", "kofi", "linktree", "colleagues").asSequence().shuffled().find { true }
return Strings.get("lt.consider_supporting", Strings.get("lt.consider_supporting.$plugType"))
}
}
Expand Down

0 comments on commit e7fe2b6

Please sign in to comment.