Public number "Ancient Kite", focusing on back-end technology, especially Java and the surrounding ecosystem.
Personal Blog:
Hello, everyone. I'm Kite.
The other day I made a groping plugin that supports most of the IDEs in Jetbrains - theAn IDE groping pluginI didn't realize that surprisingly few people used it. When I first talked about the VsCode plugin for pets, a lot of people asked if it was in IDEA or PyCharm, but where did those people go?
If no one uses it, so be it, it's not a serious thing anyway.
Let's talk about how this plugin was developed today. The source code is on GitHub!/huzhicheng/moon-drak-factory
Background
Previously, I was seeing a small plugin on VsCode called VsCode Pets, which is a plugin to raise pets in a small window in the lower left corner.
Feels very interesting, it sent an article recommended, I did not expect to be interested in a particularly large number of people, there is the beginning of the scene, someone did not IDEA version of there is no, PyCharm version of there is not.
I look at it, yoo-hoo, the demand is quite extensive, a search of the Jetbrains plugin store, there is one, but it's a little sketchy.
Once I saw this feature, it's not very complicated, so I said let's make one. It just so happens that VsCode Pets is open source, and although the code can't be reused, the material inside can be taken over and used directly.
development process
Let's start by saying that Jetbrains plugin development is something I don't know how to do, and even now that I've finished developing it, I just understand the principles.
There are two ways to develop a Jetbrains plugin, one is to use Kotlin and the other is to use Java. Kotlin is the current recommended way, but obviously I don't know how to do it, so I chose to use Java.
In IDEA, when you create a new project, there is one that is of the IDE Plugin type, specifically for plugin development.
At first I was going to follow the official docs, but I took a look at the official docs and they were really a bit much. On second thought, I'm just going to make a plugin, not learn how to make a plugin, so that's why I just started doing it.
The reason for this is that I thought there was Cursor, an IDE that has a 15-day free trial after signing up, and I had already been using it for a few days at that time, and found that it it used theclaude-3.5-sonnet
The models are awesome for writing code, and basically run directly with only fine-tuning, so I thought I'd make one while the trial period was over, and also field verify if Cursor is worth buying.
I've been working on this plugin for a weekend, plus several nights, basically every night up to 12:00 pm, how can I add up to 40 hours, which is a week's worth of work, and no one's using it, so it's a shame.
Core logic
There are two core functions of this plugin:
1, in the small window (default bottom left) to create a panel, and then in the panel to control the gif image switching and movement, with the addition of elements, switch the background, customize the background, clear the panel of these functions;
2、Implement the disturb programming mode, which is to randomly select a gif image among a bunch of gif images, and then display it in a random position in the IDE, and disappear after running for a random time within 3 seconds;
So it seems that the difficulty lies in how to create a panel in the lower left corner, and add action buttons to the panel, relatively speaking, to control the movement of gif images, switching this is relatively simple.
It's difficult because I'm completely unaware of the rules of plugin development, which are obviously clearly laid out and just follow them, but the biggest problem with familiarizing myself with them is that it takes time, and I don't want to spend that time.
This is the time to see the core value of AI, can quickly fill in your shortcomings, improve your development efficiency. Instead of completely writing code for you. See some people send some short videos said "a little programming foundation are not, purely relying on AI to do a xxxxxx product". This is pure nonsense, fooling amateurs can also be, a little programming foundation is not people can not rely on AI to do a product out.
A few key elements
Gradle type projects
Basically, you can develop a project once you've created it with IDEA, and the project is Gradle-type by default. You only need to care aboutThis configuration file is all that's needed, and nothing else. Configure the package name, version number and version support information in here.
If you have simple functionality, you don't even need to reference external dependencies at all, and if you do, they are added in this file. The only external dependency I reference for this plugin isGson
because there is some configuration content to be read and saved using the JSON format.
dependencies {
implementation(":gson:2.8.9")
}
resouces/META-INF/
This file is the equivalent of a statute declaration file, where you define where you want to create the ToolWindow, where you want to create the menus, and some of the service classes that are initially loaded.
The following is the definition of the configuration of the small window on the left, there are two initial loading service class, it is similar to the Spring dependency injection services, the plug-in is launched, the two service classes are instantiated.
<extensions defaultExtensionNs="">
<toolWindow secondary="true" icon="/icons/" anchor="left"
factoryClass=""/>
<projectService serviceImplementation=""/>
<projectService serviceImplementation=""/>
</extensions>
Here's a look at theTools
Add to the menu itemBlack Factory: Disturbance Mode
This menu item.
<actions>
<action class="" text="Black Factory: interrupt mode" description="When interrupt mode is turned on, animated elements will randomly appear in the IDE.">
<add-to-group group- anchor="last"/>
</action>
</actions>
The remaining part is to implement the logic in concrete Java classes.
In addition, you can also define the range of versions supported by the plug-in, the following plug-in supported version interval, from 2022.2 to 2024.2 this range can be.
<idea-version since-build="222" until-build="242.*" />
There's another one.<description>
The first line of the description must be in English or else it will be reviewed. If you have a plan to publish the plugin afterward, this place should pay attention to it, the first line of the description can not be Chinese, it must be English, or the review will not pass.
source material (in literature and art)
AI saves a lot of time writing code, but there's no way it can handle the material.
I'm starting to plan to just copy the material from the VsCode pets, and the naming convention is coming from there, because it's the least amount of work.
Then I felt that a bunch of animals was rather monotonous, so I wanted to add a little something else. That's what led to the KOF background and a few KOF characters. I looked for almost complete KOF 97 material picture. The background is okay, directly can be used, but the characters can not, the character movement is too much, in order to continue the logic of the pet movement, so to unify the naming rules, and then began in a pile of material to pick a few action figure, including walking, running, jumping, attacking moves, picking a good renamed, and then write to the default configuration file.
Because it's too much of a hassle, there are only 5 characters right now - Yagami, Kyo Kusanagi, Iguana, Ryo Sakazaki, and Blu-Marie, leaving the rest too much trouble to add yet.
I was going to get some Super Mario, Contra, or something like that, but then I thought better of it.
Let's just say that the whole material thing is a lot harder than writing code, in the same way that programmers don't want to write documentation, for those who know.
ultimate
It's not much to go on, but the development process is still a lot of fun, especially with the help of AI, which allows a lot of products that couldn't be made before, or took a lot of time to make, to be made very quickly.
Didn't someone say that the amount of submissions to the various app stores should get bigger after that, as it becomes easier to develop a product.
I would like to tell you that you can download this "Dark Factory" plugin when you are fishing. Just search "Dark Factory" in the plugin store.
The source code is in the/huzhicheng/moon-drak-factory
Also check out Kite's past articles
I made a web AI efficiency plugin
The main reason why I take notes every day is because this note-taking software I use is so powerful that I highly recommend you use it too!
The Best Programming Fonts in the "Stationery for Difficult Students" Series
I'm suffering from post-vacuum syndrome.
The Death of a Thousand Microservices
Building a static website has so many options and is so easy!
Being told that Lambda code looks like a mountain of shit is a result of not using the following three methods