Skip to content

Commit

Permalink
合并拉取请求 #46
Browse files Browse the repository at this point in the history
4.7.0
  • Loading branch information
mdddj authored Jul 4, 2024
2 parents cc3ba47 + c06a1a9 commit 4ca1e4e
Show file tree
Hide file tree
Showing 93 changed files with 2,029 additions and 1,094 deletions.
29 changes: 22 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,33 @@

## Unreleased

## [4.4.0] - 2024-05-25
## [4.7.0] - 2024-07-03

- Fix the problem of stuck idea or Android studio
- 修复as或者idea卡死的问题
- Reconstructed the `json to freezed class code gen` tool,
- Optimize the repair logic of `package` new version detection
- Removed some third-party dependencies and reduced the plug-in package to 1M
- If you encounter problems during use, please submit an issue
- This is the last updated version below `2023.*`. If you want to receive subsequent updates, please update your idea to
version `2024.*` and `above`.

## [4.3.1] - 2024-05-24
## [4.6.0] - 2024-06-18

- Optimize dart package version replacement logic
- Fix the bug that modifying the file pubspec.yaml may cause unresponsiveness
- After optimizing the terminal running logic, windows will no longer be created repeatedly.
- Add `part of libarary` autocomplete command
- Optimize the automatic completion popup timing of **_freezed from json_**
- Fix the problem that **_@Freezed_** does not display the freezed function

## [4.5.2] - 2024-05-30

## [4.2.5] - 2024-05-23
- Optimize dart file inlay detection performance
- Optimize some known bugs

## [4.5.0] - 2024-05-25

- Fix the problem of stuck idea or Android studio
- Upgrade kotlin version to `2.0.0` to `support k2 compiler`
- Optimize dart package version replacement logic
- Fix the bug that modifying the file pubspec.yaml may cause unresponsiveness
- Fix the problem of `flutter upgrade` and `flutter pub run build_runner build` command execution failure(idea **241+**)
- New terminal adapted to `IDEA 2024.1+`
- Fix some operation error reports. <code>Slow operations are prohibited on EDT. See
Expand Down
22 changes: 10 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.tasks.RunPluginVerifierTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

Expand All @@ -11,16 +12,15 @@ val pluginVersion: String by project
val type: String by project

plugins {
id("org.jetbrains.kotlin.jvm") version "2.0.0"
id("org.jetbrains.intellij") version "1.16.1"
idea
kotlin("jvm") version "2.0.0"
id("org.jetbrains.intellij") version "1.17.4"
id("org.jetbrains.changelog") version "2.2.0"
}

group = "shop.itbug"
version = pluginVersion + type

repositories {
mavenLocal()
mavenCentral()
google()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
Expand All @@ -38,13 +38,15 @@ val pluginList = mutableListOf(
)



intellij {
version.set(ideaVersion)
if (ideaType.trim().isNotBlank()) {
type.set(ideaType)
}
plugins.set(pluginList)
}

kotlin {
sourceSets.all {
languageSettings {
Expand All @@ -54,10 +56,7 @@ kotlin {
}

dependencies {
implementation("cn.hutool:hutool-http:latest.release")
implementation("org.smartboot.socket:aio-pro:latest.release")
implementation("com.alibaba.fastjson2:fastjson2:latest.release")
testImplementation(kotlin("test"))
}

val pushToken: String? = System.getenv("idea_push_token")
Expand Down Expand Up @@ -121,12 +120,7 @@ tasks {
}

configurations.all {
}

verifyPlugin {
}

verifyPluginConfiguration {
}

}
Expand All @@ -137,3 +131,7 @@ changelog {
path = file("CHANGELOG.md").canonicalPath
groups.empty()
}

tasks.withType(RunPluginVerifierTask::class.java) {
ideVersions.set(listOf("2024.1.3", "2024.1.2"))
}
16 changes: 9 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
kotlin.stdlib.default.dependency=true
kotlin.incremental.useClasspathSnapshot=false
#kotlin.experimental.tryK2=true
kapt.use.k2=true
pluginVersion=4.4.0.
kotlin.stdlib.default.dependency=false
pluginVersion=4.7.0.
#===============================> 231
#dartVersion=231.9411
#sinceBuildVersion=231
Expand Down Expand Up @@ -32,9 +29,14 @@ pluginVersion=4.4.0.
#ideaType=
#type=241
#========================================242 idea
dartVersion=242.10180.28
dartVersion=242.19533.43
sinceBuildVersion=242
untilBuildVersion=242.*
ideaVersion=242-EAP-SNAPSHOT
ideaType=
type=242
type=242
# proxy
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=7890
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=7890
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=file\:///Users/ldd/gradle/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package shop.itbug.fluttercheckversionx.actions

import com.alibaba.fastjson2.JSON
import com.alibaba.fastjson2.JSONWriter
import com.google.gson.Gson
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import shop.itbug.fluttercheckversionx.common.MyAction
import shop.itbug.fluttercheckversionx.document.copyTextToClipboard

class ApiCopyAll:MyAction({"Copy All"}) {
class ApiCopyAll : MyAction({ "Copy All" }) {
override fun actionPerformed(e: AnActionEvent) {



val api = e.api()!!
val dataMap = mutableMapOf(
"url" to api.url,
Expand All @@ -20,28 +18,28 @@ class ApiCopyAll:MyAction({"Copy All"}) {
)

api.queryParams?.apply {
if(this.isNotEmpty()){
if (this.isNotEmpty()) {
dataMap["queryParams"] = this
}
}
api.body?.apply {
if(this is Map<*, *> && this.isNotEmpty()){
if (this is Map<*, *> && this.isNotEmpty()) {
dataMap["body"] = this
}
}

dataMap["responseStatusCode"] = api.statusCode
dataMap["response"] = api.getDataJson()
dataMap["response"] = api.getDataJson()
dataMap["requestTime"] = api.createDate
dataMap["timestamp"] = api.timestamp

val toJSONString = JSON.toJSONString(dataMap, JSONWriter.Feature.PrettyFormat)
toJSONString.copyTextToClipboard()
val string = Gson().toJson(dataMap)
string.copyTextToClipboard()
}


override fun update(e: AnActionEvent) {
e.presentation.isEnabled = e.api()!=null
e.presentation.isEnabled = e.api() != null
super.update(e)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package shop.itbug.fluttercheckversionx.actions

import cn.hutool.core.util.URLUtil
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import shop.itbug.fluttercheckversionx.common.MyAction
import shop.itbug.fluttercheckversionx.document.copyTextToClipboard
import shop.itbug.fluttercheckversionx.util.toast
import java.net.URL


///复制路径
class ApiCopyPathAction: MyAction({"Copy Path"}) {
class ApiCopyPathAction : MyAction({ "Copy Path" }) {
override fun actionPerformed(e: AnActionEvent) {
val url = e.api()!!.url
val path = URLUtil.getPath(url)
val path = URL(url).path

path.copyTextToClipboard().apply {
e.project?.toast("Copy succeeded!")
}
}

override fun update(e: AnActionEvent) {
e.presentation.isEnabled = e.api()!=null
e.presentation.isEnabled = e.api() != null
super.update(e)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import com.intellij.ui.components.fields.ExtendableTextComponent
import com.intellij.ui.components.fields.ExtendableTextField
import com.intellij.util.ui.FormBuilder
import com.jetbrains.lang.dart.DartFileType
import icons.DartIcons
import shop.itbug.fluttercheckversionx.common.MyDumbAwareAction
import shop.itbug.fluttercheckversionx.icons.MyIcons
import java.awt.event.KeyAdapter
import java.awt.event.KeyEvent
import javax.swing.BorderFactory
Expand All @@ -30,12 +30,12 @@ class DartFileGroupAction : MyDumbAwareAction() {
private lateinit var project: Project
private lateinit var virtualFile: VirtualFile
private val popup = JBPopupFactory.getInstance().createComponentPopupBuilder(showForm, null)
.setRequestFocus(true)
.setTitle("文件名")
.setCancelKeyEnabled(true)
.setResizable(true)
.setMovable(true)
.createPopup()
.setRequestFocus(true)
.setTitle("文件名")
.setCancelKeyEnabled(true)
.setResizable(true)
.setMovable(true)
.createPopup()

init {
fileNameTextFiled.border = BorderFactory.createEmptyBorder()
Expand Down Expand Up @@ -111,7 +111,7 @@ class DartFileGroupAction : MyDumbAwareAction() {
///图标
class TextfiledExtends : ExtendableTextComponent.Extension {
override fun getIcon(hovered: Boolean): Icon {
return DartIcons.Dart_file
return MyIcons.dartPackageIcon
}

override fun isIconBeforeText(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
package shop.itbug.fluttercheckversionx.actions

import com.alibaba.fastjson2.JSON
import com.google.gson.Gson
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
import shop.itbug.fluttercheckversionx.form.socket.Request
import shop.itbug.fluttercheckversionx.socket.service.AppService


fun Request.getDataJson() : Any {
if(data is Map<*, *>) {
fun Request.getDataJson(): Any {
if (data is Map<*, *>) {
return data
}
if(data is String && JSON.isValid(data)) {
return JSON.parse(data)
if (data is String) {
return try {
Gson().fromJson(data, Map::class.java)
} catch (e: Exception) {
data
}
}
return data ?: ""
return data
}

///获取当前选中的项目
Expand Down
Loading

0 comments on commit 4ca1e4e

Please sign in to comment.