Skip to content

Commit

Permalink
Merge pull request #37 from sloppylopez/feature/Minor_Fixes
Browse files Browse the repository at this point in the history
Feature/big fixes
  • Loading branch information
sloppylopez authored Jan 6, 2025
2 parents 475b922 + 227dca7 commit 9a87075
Show file tree
Hide file tree
Showing 42 changed files with 1,090 additions and 649 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
# Build plugin
- name: Build plugin
run: ./gradlew buildPlugin
continue-on-error: true

# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
Expand All @@ -90,6 +91,7 @@ jobs:
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
continue-on-error: true

# Store already-built plugin as an artifact for downloading
- name: Upload artifact
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.idea
.qodana
build
certs
certs
.kotlin
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
// kotlin("plugin.serialization") version "1.6.0" // Kotlin Serialization support
kotlin("plugin.serialization") version "1.9.10" // Kotlin Serialization support
}

group = properties("pluginGroup").get()
Expand All @@ -28,18 +28,26 @@ dependencies {
testImplementation("org.mockito:mockito-core:5.4.0")
testImplementation("junit:junit:4.13.2")
implementation("com.google.code.gson:gson:2.10.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.0")
implementation("com.google.api:gax:2.31.0")
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk17:2.0.20")
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
implementation("org.jetbrains.kotlin:kotlin-reflect:2.0.20")
implementation("com.google.api:gax:2.58.0")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.1")
implementation("org.jetbrains:annotations:23.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") // Use the latest version
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")
// implementation("org.openjfx:javafx:11")
}

// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
jvmToolchain(17)
jvmToolchain(20)
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(20)) // Replace 21 with the desired Java version
}
}

// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
Expand Down
29 changes: 28 additions & 1 deletion docs/PITFALLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,31 @@ with characters such as ‘?.!’ which helps GPT recognise questions, sentences
A) From main IDE run config 'runIde'
B) From second IDE run 'Attach to process'
C) Breaking points go on FIRST IDE
D) Profit :)
D) Profit :)

7)
Promotional content for a free product that genuinely adds value to developers’ lives can still work well on Hacker News, provided the tone and approach are tailored to the community's expectations. Hacker News readers are receptive to free tools if the presentation is informative, transparent, and focused on solving real developer problems.

Here’s how you can effectively promote your free IntelliJ plugin:

1. Position Your Post as Value-Driven (Not Salesy)
Frame your post around how the plugin helps developers rather than focusing on promotional aspects.
Example post titles:
"We made a free IntelliJ plugin to refactor code instantly—no catch!"
"Frustrated with repetitive coding tasks? Check out this free IntelliJ plugin we built."
"Tired of messy codebases? A free tool that refactors code in one click."
2. Structure Your Post
Headline:
Keep it concise, intriguing, and clear. Mention that the tool is free and highlights a developer pain point.

Body:

Introduction: Start with the problem developers face (e.g., repetitive refactoring or messy codebases).
Solution: Briefly explain your plugin and what it does.
Why It’s Free: Be transparent about why you’re offering the tool for free (e.g., building trust, contributing to the developer community, or gathering feedback).
Call to Action: Share a direct link to the plugin or the JetBrains Marketplace. Include installation instructions or a quick-start guide for convenience.
Request Feedback: Invite readers to share thoughts or suggestions. This not only engages the audience but also aligns with Hacker News' culture of constructive discussion.
3. Timing is Key
Post your content during peak engagement hours for Hacker News:
Between 8 AM and 12 PM (PST) on weekdays.
Tuesday and Wednesday are generally high-traffic days.
65 changes: 65 additions & 0 deletions docs/advetisementScript.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Script (1 Minute)
Scene 1: The Call (10 seconds)
Visuals:

A cozy bedroom at night. The developer snores peacefully in bed.
Their phone buzzes violently on the nightstand, flashing "BOSS CALLING" in bold red letters.
Narration:
"Finally asleep, but your boss has other plans..."

Sound Effects:

Phone ringing obnoxiously.
Text on Screen:
"The life of a developer..."

Scene 2: The Impossible Task (15 seconds)
Visuals:

The boss yells furiously through the phone (split screen):
Boss: "Refactor the ENTIRE codebase into FOUR languages by yesterday! Or else!"
Cut to the developer, wide-eyed in disbelief, whispering: "What?!"
Text on Screen:
"Impossible requests? We've all been there."

Twist:

The bed starts rumbling. Wheels and headlights pop out, and it drives off! with the developer on it and comfortably alying like sleeping
Sound Effects:

Whimsical engine revs as the bed zooms out of the house.
Scene 3: The Journey & Solution (25 seconds)
Visuals:

The bed hilariously speeds through absurd locations with the developer on it:
A drive-thru, a beach, and straight into the office building.
It screeches to a halt in front of a computer.
The developer clicks "Refactor Now" in IntelliJ IDEA with MoneyPenny AI Plugin.
Screen shows chaotic code transforming into clean, beautiful code in seconds.
Text on Screen:
"Refactor your code in just ONE click."

Narration:
"With MoneyPenny AI, even the impossible is easy."

Scene 4: The Reward (10 seconds)
Visuals:

The bed drives the developer back home, parks perfectly in the bedroom.
The boss texts: "Genius! Great work!"
The developer smirks, turns off the phone, and snuggles back to sleep.
Text on Screen:
"Go from stressed to success—effortlessly."

Call to Action (5 seconds)
Visuals:

The MoneyPenny AI logo with the tagline:
"MoneyPenny AI: Refactor your code in ONE click."
Narration:
"Stop wasting time. Try MoneyPenny AI today!"

Text on Screen:
"Download Now. Impossible? Solved."

Voices are all in male british
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginGroup=com.github.sloppylopez.moneypennyideaplugin
pluginName=moneypenny-idea-plugin
pluginRepositoryUrl=https://github.com/sloppylopez/moneypenny-idea-plugin
# SemVer format -> https://semver.org
pluginVersion=2.0.2-SNAPSHOT
pluginVersion=2.0.3
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=243.0
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
Expand All @@ -27,4 +27,4 @@ org.gradle.caching = true
systemProp.org.gradle.unsafe.kotlin.assignment = true

# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom
kotlin.incremental.useClasspathSnapshot = false
#kotlin.incremental.useClasspathSnapshot = false
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
annotations = "24.0.1"

# plugins
kotlin = "1.9.0"
kotlin = "2.0.20" # Update Kotlin version here
changelog = "2.1.2"
gradleIntelliJPlugin = "1.15.0"
qodana = "0.1.13"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
package com.github.sloppylopez.moneypennyideaplugin.actions

import com.github.sloppylopez.moneypennyideaplugin.services.ProjectService
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project

@Service(Service.Level.PROJECT)
class AddTextAction(private val project: Project) : AnAction() {
private val service = project.service<ProjectService>()

init {
templatePresentation.icon = AllIcons.Chooser.Left
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import com.intellij.icons.AllIcons
import com.intellij.notification.NotificationType
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project

@Service(Service.Level.PROJECT)
class CopyPromptAction(private var project: Project) : AnAction() {
private val service: ProjectService by lazy { project.service<ProjectService>() }
private val promptService: PromptService by lazy { project.service<PromptService>() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DRYSelectionAction(private var project: Project) : AnAction() {
private val service: ProjectService by lazy { project.service<ProjectService>() }
private val chatGPTService: ChatGPTService by lazy { project.service<ChatGPTService>() }
private val copiedMessage = "Copied to clipboard: "
private val progressBarFactory: ProgressBarFactory by lazy { project.service<ProgressBarFactory>() }
// private val progressBarFactory: ProgressBarFactory by lazy { project.service<ProgressBarFactory>() }

init {
templatePresentation.icon = AllIcons.Diff.MagicResolve
Expand All @@ -31,14 +31,14 @@ class DRYSelectionAction(private var project: Project) : AnAction() {
override fun actionPerformed(e: AnActionEvent) {
val file = getFile(e) ?: return
val editor = getEditor(e) ?: return
val jProgressBar = progressBarFactory.getProgressBar()
// val jProgressBar = progressBarFactory.getProgressBar()
val selectedText = service.getSelectedTextFromEditor(
editor
)
chatGPTService.sendChatPrompt(
getPrompt(selectedText), createCallback(file), null, null
).whenComplete { _, _ ->
progressBarFactory.removeProgressBar(GlobalData.innerPanel!!, jProgressBar)
// progressBarFactory.removeProgressBar(GlobalData.innerPanel!!, jProgressBar)
}
}
//This is for right click action only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package com.github.sloppylopez.moneypennyideaplugin.actions

import com.github.sloppylopez.moneypennyideaplugin.helper.ToolWindowHelper.Companion.getIcon
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.components.Service
import com.intellij.openapi.project.Project

@Service(Service.Level.PROJECT)
class PopUpHooverAction : ActionGroup() {

companion object {
Expand All @@ -20,9 +18,10 @@ class PopUpHooverAction : ActionGroup() {

// Return the actions for the submenu
override fun getChildren(e: AnActionEvent?): Array<AnAction> {
val project = getProjectFromEvent(e)
val project = getProjectFromEvent(e)!!
return arrayOf(
SendToPromptTextEditorAction(project!!),
SendToPromptTextEditorActionConcat(project),
SendToPromptTextEditorActionParallel(project),
DRYSelectionAction(project)
)//TODO Add more actions here
}
Expand Down
Loading

0 comments on commit 9a87075

Please sign in to comment.