Skip to content

Commit

Permalink
Adds formatting plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Roboroads committed Nov 3, 2021
1 parent b08c7e1 commit a9beb98
Show file tree
Hide file tree
Showing 25 changed files with 881 additions and 826 deletions.
111 changes: 57 additions & 54 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,136 +5,139 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- [Kotlin AutoAormatter](https://github.com/hovinen/kotlin-auto-formatter) plugin (since I'm lazy).
- Also formatted code with this plugin.
### Changes
- Merged changes from JetBrains plugin template
- [[#120]](https://github.com/Roboroads/laravel-tinker/issues/120) Changes remote tip text in settings
- Merged changes from JetBrains plugin template.
- [[#120]](https://github.com/Roboroads/laravel-tinker/issues/120) Changes remote tip text in settings.
### Fixed
- [[#121]](https://github.com/Roboroads/laravel-tinker/issues/121) Exception when the IDE has no foreground color for given attribute
- [[#121]](https://github.com/Roboroads/laravel-tinker/issues/121) Exception when the IDE has no foreground color for given attribute.
## [2.3.0]
### Added
- [[#112]](https://github.com/Roboroads/laravel-tinker/issues/112) Adds <kbd>Open new console</kbd> and <kbd>Reopen last console</kbd> actions to the tinker output toolwindow.

### Changed
- Cleaned up the output toolwindow a little bit.
- Added dependabot updates [#113](https://github.com/Roboroads/laravel-tinker/pull/113) & [#114](https://github.com/Roboroads/laravel-tinker/pull/114)
- Added dependabot updates [#113](https://github.com/Roboroads/laravel-tinker/pull/113) & [#114](https://github.com/Roboroads/laravel-tinker/pull/114).

### Fixed
- [[#110]](https://github.com/Roboroads/laravel-tinker/issues/110) Fixes typo in caster for the Model class
- [[#110]](https://github.com/Roboroads/laravel-tinker/issues/110) Fixes typo in caster for the Model class.

## [2.2.2]
### Added
- Way of migrating to newer versions of this plugin
- [[#105]](https://github.com/Roboroads/laravel-tinker/pull/105) Adds the stringable caster added in [laravel/tinker v2.6.1](https://github.com/laravel/tinker/pull/121)
- Thanks [@emargareten](https://github.com/emargareten)
- Way of migrating to newer versions of this plugin.
- [[#105]](https://github.com/Roboroads/laravel-tinker/pull/105) Adds the stringable caster added in [laravel/tinker v2.6.1](https://github.com/laravel/tinker/pull/121).
- Thanks [@emargareten](https://github.com/emargareten).

### Changed
- Restyling of Tinker console tabs.

### Fixed
- [[#61]](https://github.com/Roboroads/laravel-tinker/issues/61) Fixes re-indexing issue causing infinite errors and 100% CPU
- [[#61]](https://github.com/Roboroads/laravel-tinker/issues/61) Fixes re-indexing issue causing infinite errors and 100% CPU.
- Big thanks to [@fawzanm](https://github.com/fawzanm) who helped me figure out a reproduction method and testing my fix.

## [2.2.1]
### Added
- [[#96]](https://github.com/Roboroads/laravel-tinker/issues/96) Added compatibility with newer API versions
- [[#96]](https://github.com/Roboroads/laravel-tinker/issues/96) Added compatibility with newer API versions.

## [2.2.0]
### Added
- [[#34]](https://github.com/Roboroads/laravel-tinker/issues/34) Setting to change tinker execution root
- [[#34]](https://github.com/Roboroads/laravel-tinker/issues/34) Setting to change tinker execution root.

### Fixed
- [[#75]](https://github.com/Roboroads/laravel-tinker/issues/75) Empty directory list of tinker consoles resulting in fatal error.

## [2.1.0]
### Added
- Dependabot
- Dependabot.
- [[#35]](https://github.com/Roboroads/laravel-tinker/issues/35) Setting to enable/disable line wrapping in output window.
- [[#33]](https://github.com/Roboroads/laravel-tinker/issues/33) Adds way for Patreon supporters to disable the support plug.

### Changed
- [[#53]](https://github.com/Roboroads/laravel-tinker/issues/53) Updates compatibility with 2021.1
- Updated all dependencies
- [[#53]](https://github.com/Roboroads/laravel-tinker/issues/53) Updates compatibility with 2021.1.
- Updated all dependencies.

### Removed
- Tinker Consoles having an IS_TINKER_CONSOLE userdata key.

### Fixed
- [[#47]](https://github.com/Roboroads/laravel-tinker/issues/47) [[#40]](https://github.com/Roboroads/laravel-tinker/issues/40) `<` and `>` are now replaced by `&gt;` and `&lt;` to make them not parse as HTML in tinker output
- [[#47]](https://github.com/Roboroads/laravel-tinker/issues/47) [[#40]](https://github.com/Roboroads/laravel-tinker/issues/40) `<` and `>` are now replaced by `&gt;` and `&lt;` to make them not parse as HTML in tinker output.
- [[#40]](https://github.com/Roboroads/laravel-tinker/issues/40) Fixes always showing output on the last opened project when having multiple projects open.
- [[#41]](https://github.com/Roboroads/laravel-tinker/issues/41) When pressing the x icon on the progress bar to stop the PHP execution, the process now gets destroyed within 250ms.

## [2.0.1]
### Changed
- New branding by [Joey "Veritas" de Vries](https://joeyveritas.nl)
- New branding by [Joey "Veritas" de Vries](https://joeyveritas.nl).

### Fixed
- [[#50]](https://github.com/Roboroads/laravel-tinker/issues/50) Tinker Create/Smart action overwriting its own files from a previous session.
- Tinker files not being PHP when project reloads.

## [2.0.0]
### Added
- BREAKING: [[#39]](https://github.com/Roboroads/laravel-tinker/issues/39) Tinker consoles are now available under "Scratches and Consoles"
- [[#37]](https://github.com/Roboroads/laravel-tinker/issues/37) [[#38]](https://github.com/Roboroads/laravel-tinker/issues/38) When selecting text and running the `Smart Action` a new console opens with your selected text
- This can also be achieved by selecting text, right-clicking and selecting `Open Tinker Console With Selection`
- BREAKING: [[#39]](https://github.com/Roboroads/laravel-tinker/issues/39) Tinker consoles are now available under "Scratches and Consoles".
- [[#37]](https://github.com/Roboroads/laravel-tinker/issues/37) [[#38]](https://github.com/Roboroads/laravel-tinker/issues/38) When selecting text and running the `Smart Action` a new console opens with your selected text.
- This can also be achieved by selecting text, right-clicking and selecting `Open Tinker Console With Selection`.

### Changed
- BREAKING: Every action is now independently listed
- The default action is now "Smart Action" which will have kind-of the same functionality as you have been using it up till now
- BREAKING: Every action is now independently listed.
- The default action is now "Smart Action" which will have kind-of the same functionality as you have been using it up till now.
- Every action this plugin can do is now individually bindable in your keymap.

### Removed
- BREAKING: Per-project cache (which stored your last executed tinker code)
- BREAKING: Per-project cache (which stored your last executed tinker code).
- You can probably find your last snippet still in `%Project%/.idea/laravel-tinker.xml` if you really need it!
- `%Project%/.idea/laravel-tinker.xml` can be deleted otherwise.

### Other
- Reorganization of a lot of classes
- Dependencies have been updated
- Reorganization of a lot of classes.
- Dependencies have been updated.

## [1.3.1]
### Changed
- Updated dependencies
- Updated dependencies.

### Fixed
- Compatibility with 2020.3
- Compatibility with 2020.3.

## [1.3.0]
### Added
- Laravel Tinker settings page (under Tools)
- [[#30]](https://github.com/Roboroads/laravel-tinker/issues/30) Ability to disable start and finish messages in output
- [[#21]](https://github.com/Roboroads/laravel-tinker/issues/21) Ability to add a shortcut to close all involving Tinker
- Laravel Tinker settings page (under Tools).
- [[#30]](https://github.com/Roboroads/laravel-tinker/issues/30) Ability to disable start and finish messages in output.
- [[#21]](https://github.com/Roboroads/laravel-tinker/issues/21) Ability to add a shortcut to close all involving Tinker.

### Changed
- Dependencies updated to the latest versions
- Dependencies updated to the latest versions.

### Fixed
- The title of the tinker screen was editable - now it isn't.
- [[#28]](https://github.com/Roboroads/laravel-tinker/issues/28) Ending your tinker console with a comment now works correctly again
- Credits to [@emargareten](https://github.com/emargareten)
- [[#28]](https://github.com/Roboroads/laravel-tinker/issues/28) Ending your tinker console with a comment now works correctly again.
- Credits to [@emargareten](https://github.com/emargareten).

## [1.2.1]
### Added
- [[#25]](https://github.com/Roboroads/laravel-tinker/issues/25) When running tinker it will now save all documents before executing
- [[#25]](https://github.com/Roboroads/laravel-tinker/issues/25) When running tinker it will now save all documents before executing.

### Fixed
- [[#23]](https://github.com/Roboroads/laravel-tinker/issues/23) Fixed a bug where output would display twice when the output highlighter didn't find output to highlight.

## [1.2.0]
### Added
- [[#7]](https://github.com/Roboroads/laravel-tinker/issues/7) Output syntax highlighting
- [[#7]](https://github.com/Roboroads/laravel-tinker/issues/7) Output syntax highlighting.

### Fixed
- [[#11]](https://github.com/Roboroads/laravel-tinker/issues/11) Plugin won't create a null file anymore on windows.
- [[#16]](https://github.com/Roboroads/laravel-tinker/issues/16) Only 1 tinker console will be open at all times.
- [[#18]](https://github.com/Roboroads/laravel-tinker/issues/18) Added the LARAVEL_START constant to the tinker run script.
- [[#19]](https://github.com/Roboroads/laravel-tinker/issues/19) Colors in output window now reset to IDE colors when running.
- [[#12]](https://github.com/Roboroads/laravel-tinker/issues/12) [[#20]](https://github.com/Roboroads/laravel-tinker/issues/20) Fixes `Class 'Laravel\Tinker\ClassAliasAutoloader' not found`
- By just checking if it exists before loading it
- Should fix the plugin for laravel/tinker versions `<= 1.0.1`
- By just checking if it exists before loading it.
- Should fix the plugin for laravel/tinker versions `<= 1.0.1`.

## [1.1.1]
### Added
- [[#10]](https://github.com/Roboroads/laravel-tinker/issues/10) Your last command will now be saved (on per-project level)
- [[#10]](https://github.com/Roboroads/laravel-tinker/issues/10) Your last command will now be saved (on per-project level).
- Non-obtrusive reminder you can support this package.


Expand All @@ -143,41 +146,41 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Fixed
- The link to PHP settings in error dialogs now *acually* links to the correct settings page.
- [[#9]](https://github.com/Roboroads/laravel-tinker/issues/9) Output showing slow on larger outputs
- [[#9]](https://github.com/Roboroads/laravel-tinker/issues/9) Output showing slow on larger outputs.

## [1.1.0]
### Added
- Run button at the opening tag of the tinker console
- Run button at the opening tag of the tinker console.

### Changed
- Cleaned output of tinker output window
- PHP Runner script is now a php file, makes it easier to work with in the IDE.


### Fixed
- Default keybinding in Mac OS
- Toolwindow not opening automatically if not opened before
- Leaving zombie processes (something pcntl did)
- Silent crash when docker was not set
- Tinker process not shutting down because of waiting for non-existent input
- Default keybinding in Mac OS.
- Toolwindow not opening automatically if not opened before.
- Leaving zombie processes (something pcntl did).
- Silent crash when docker was not set.
- Tinker process not shutting down because of waiting for non-existent input.

## [1.0.0]
### Added
- [[#1]](https://github.com/Roboroads/laravel-tinker/issues/1) A correct way to interact with remote interpreters
- [[#1]](https://github.com/Roboroads/laravel-tinker/issues/1) A correct way to interact with remote interpreters.

### Changed
- Made errors more to the point
- Better code splitting in message balloons
- More text in the readme
- Better formatting in tinker output
- Made errors more to the point.
- Better code splitting in message balloons.
- More text in the readme.
- Better formatting in tinker output.


### Fixed
- Laravel now actually gets bootstrapped
- Removed needless output from interpreter, like docker startup messages
- Made output toolwindow font show in readable colors
- Campatibility issues that arose in 0.0.1-ALPHA
- Laravel now actually gets bootstrapped.
- Removed needless output from interpreter, like docker startup messages.
- Made output toolwindow font show in readable colors.
- Campatibility issues that arose in 0.0.1-ALPHA.

## [0.0.1-ALPHA]
### Added
- Everything
- Everything.
80 changes: 47 additions & 33 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ plugins {
id("org.jetbrains.changelog") version "1.3.1"
// Gradle Qodana Plugin
id("org.jetbrains.qodana") version "0.1.13"
// Kotlin formatter
id("tech.formatter-kt.formatter") version "0.7.9"
}

group = properties("pluginGroup")
version = properties("pluginVersion")

// Configure project's dependencies
repositories {
mavenCentral()
}
repositories { mavenCentral() }

dependencies {
implementation("at.favre.lib:bcrypt:0.9.0")
Expand All @@ -36,10 +36,13 @@ intellij {
type.set(properties("platformType"))

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
plugins.set(
properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)
)
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
// Configure Gradle Changelog Plugin - read more:
// https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version.set(properties("pluginVersion"))
groups.set(emptyList())
Expand All @@ -55,44 +58,49 @@ qodana {

tasks {
// Set the JVM compatibility versions
properties("javaVersion").let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = it
properties("javaVersion")
.let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
withType<KotlinCompile> { kotlinOptions.jvmTarget = it }
}
}

wrapper {
gradleVersion = properties("gradleVersion")
}
wrapper { gradleVersion = properties("gradleVersion") }

patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
// Extract the <!-- Plugin description --> section from README.md and provide for the
// plugin's manifest
pluginDescription.set(
projectDir.resolve("README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
projectDir.resolve("README.md")
.readText()
.lines()
.run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

if (!containsAll(listOf(start, end))) {
throw GradleException(
"Plugin description section not found in README.md:\n$start ... $end"
)
}
subList(indexOf(start) + 1, indexOf(end))
}
subList(indexOf(start) + 1, indexOf(end))
}.joinToString("\n").run { markdownToHTML(this) }
.joinToString("\n")
.run { markdownToHTML(this) }
)

// Get the latest available change notes from the changelog file
changeNotes.set(provider {
changelog.run {
getOrNull(properties("pluginVersion")) ?: getLatest()
}.toHTML()
})
changeNotes.set(
provider {
changelog.run { getOrNull(properties("pluginVersion")) ?: getLatest() }.toHTML()
}
)
}

// Configure UI tests plugin
Expand All @@ -113,9 +121,15 @@ tasks {
publishPlugin {
dependsOn("patchChangelog")
token.set(System.getenv("PUBLISH_TOKEN"))
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release
// labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel
// automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
channels.set(
listOf(
properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()
)
)
}
}
7 changes: 5 additions & 2 deletions src/main/kotlin/nl/deschepers/laraveltinker/Strings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ private const val BUNDLE = "strings.strings"

object Strings : AbstractBundle(BUNDLE) {
@JvmStatic
fun get(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
getMessage(key, *params)
fun get(
@PropertyKey(resourceBundle = BUNDLE)
key: String,
vararg params: Any
) = getMessage(key, *params)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ import com.intellij.openapi.options.ShowSettingsUtil
import nl.deschepers.laraveltinker.Strings
import nl.deschepers.laraveltinker.settings.ProjectSettingsConfigurable

class EditLaravelTinkerProjectSettingsAction : NotificationAction(
Strings.get("lt.settings.tinker_project_settings")
) {
class EditLaravelTinkerProjectSettingsAction :
NotificationAction(Strings.get("lt.settings.tinker_project_settings")) {

override fun actionPerformed(e: AnActionEvent, notification: Notification) {
val project = e.project
if (project != null) {
ShowSettingsUtil.getInstance().showSettingsDialog(
project,
ProjectSettingsConfigurable::class.java
)
ShowSettingsUtil.getInstance()
.showSettingsDialog(project, ProjectSettingsConfigurable::class.java)
}
}
}
Loading

0 comments on commit a9beb98

Please sign in to comment.