How to achieve the effect of Inlay hint on the list above each function, separating and triggering by clicking?

已计划

Desired:

This implementation effect is very unique. It's like a list implementation, where each one can be clicked and separated, but it's also like a drawing. You can directly click on it and enter the function in one go. The experience is very good。


Implemented by oneself:

Now I can only achieve the effect of one icon, and when clicked, there will be a popMeun that needs to be clicked twice. The display is not as good as before, to select functions, what solutions are available, etc. Thank you!

My Code:

0

Could you please share your implementation source code that results in

Now I can only achieve the effect of one icon, and when clicked, there will be a popMeun that needs to be clicked twice.

AFAIU the sample code adds only one element per PsiMethod

0

Oh, thank you. I'm glad I've achieved this effect, but now it can only be recognized for use on Java language, not Python. Is there any solution

plugin.xml

code-python.xml

build.gradle

plugins {
    id 'org.jetbrains.intellij' version '1.17.4'
}

repositories {
    mavenLocal()
    maven {
        allowInsecureProtocol = true
        url "http://maven.aliyun.com/nexus/content/groups/public/"
    }
}

dependencies {
    implementation 'org.projectlombok:lombok:1.18.32'
    annotationProcessor 'org.projectlombok:lombok:1.18.32'

    implementation 'com.google.guava:guava:33.2.0-jre'

    implementation 'org.slf4j:slf4j-api:1.7.30'
    implementation 'ch.qos.logback:logback-classic:1.2.3'

    implementation 'cn.hutool:hutool-all:5.8.27'
    implementation 'com.alibaba.fastjson2:fastjson2:2.0.49'
    implementation 'org.apache.commons:commons-text:1.12.0'
    implementation 'org.apache.httpcomponents:httpclient:4.5.14'
    implementation 'com.vladsch.flexmark:flexmark-all:0.64.8'

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

intellij {
    version.set("2024.1.1")
    type.set("IC")
    plugins.set(['java'])
}



patchPluginXml {
    changeNotes = """
      Add change notes here.<br>
      <em>most HTML tags may be used</em>"""
    sinceBuild.set("223")
    untilBuild.set("243")
}

test {
    useJUnitPlatform()
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = "UTF-8"
}

 

 

0

I tried to change build.gradle and add Python, but encountered an error

plugins {
    id 'org.jetbrains.intellij' version '1.17.4'
}
intellij {
    version.set("2024.1.1")
    type.set("IC")
    plugins.set(['java','com.intellij.python'])
}
error ; org.gradle.tooling.BuildException: Cannot find builtin plugin 'com.intellij.python' for IDE: D:\envi\gradle-rep\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2024.1.1\610065d2e218939d0671358b7be2dd8509c64758\ideaIC-2024.1.1
    

 

0

https://plugins.jetbrains.com/docs/intellij/pycharm.html.。The Java ID has been changed, this URL cannot be accessed, 404

 

0

I have looked at your configuration, where did it go wrong

build.gradle

plugins {
    id 'org.jetbrains.intellij' version '1.17.4'
}

repositories {
    mavenLocal()
    maven {
        allowInsecureProtocol = true
        url "http://maven.aliyun.com/nexus/content/groups/public/"
    }
}

dependencies {
    implementation 'org.projectlombok:lombok:1.18.32'
    annotationProcessor 'org.projectlombok:lombok:1.18.32'

    implementation 'com.google.guava:guava:33.2.0-jre'

    implementation 'org.slf4j:slf4j-api:1.7.30'
    implementation 'ch.qos.logback:logback-classic:1.2.3'

    implementation 'cn.hutool:hutool-all:5.8.27'
    implementation 'com.alibaba.fastjson2:fastjson2:2.0.49'
    implementation 'org.apache.commons:commons-text:1.12.0'
    implementation 'org.apache.httpcomponents:httpclient:4.5.14'
    implementation 'com.vladsch.flexmark:flexmark-all:0.64.8'

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
intellij {
    version.set("2024.1.1")
    type.set("PC")
    plugins.set(["PythonCore"])
    downloadSources.set(false)
}



patchPluginXml {
    changeNotes = """
      Add change notes here.<br>
      <em>most HTML tags may be used</em>"""
    sinceBuild.set("223")
    untilBuild.set("243")
}

test {
    useJUnitPlatform()
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = "UTF-8"
}

 

ERROE

Execution failed for task ':instrumentCode'.
> taskdef class com.intellij.ant.InstrumentIdeaExtensions cannot be found

* Try:
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':instrumentCode'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:128)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
 

 

0

Hello, Yann Cebronthank you. The above issue has been resolved, but one problem has been found. If the type is set to CL, it is possible to import Clion and Python, but if IU is set, it will fail

success

plugins {
    id 'java'
    id 'org.jetbrains.intellij' version '1.17.4'
}

intellij {
    version.set("2024.1.1")
    type.set("CL")
    plugins.set(["PythonCore","com.intellij.clion"])
    downloadSources.set(false)
}

error

intellij {
    version.set("2024.1.1")
    type.set("IU")
    plugins.set(["PythonCore","com.intellij.clion"])
    downloadSources.set(false)
}

org.gradle.tooling.BuildException: Cannot find builtin plugin 'PythonCore' for IDE:

I hope to receive help, thank you!

0

Sorry the links were broken, fixed.

You cannot mix all IDEs and plugins in one module, as they're simply not compatible and do not contain the same set of bundled plugins. You'll need to extract functionality targeting such IDEs into a separate module only targeting this specific IDE, and then combine all modules into your final plugin.

0

Hello, Yann Cebronthank you. You'll need to extract functionality targeting such IDEs into a separate module only targeting this specific IDE, and then combine all modules into your final plugin.How is this sentence implemented? Can you give a simple example? Thank you

0

Okay, thank you. Yann Cebron.I would like to ask if there is a Csharp plugin ID for importing modules

intellij {
    version.set("2024.1.1")
    type.set("RD")
    downloadSources.set(false)
}

0

No plugin to add in Gradle, in plugin.xml use

<depends>com.intellij.modules.rider</depends>

0

Okay, thank you, it's resolved

0

请先登录再写评论。