https://kotlinlang.org logo
Join SlackCommunities
Powered by
# intellij-plugins
  • j

    Jan Tobola

    05/19/2024, 4:44 PM
    Hello, everyone ✋. I am creating a theme. Besides colors and other simple values that are allowed in the
    .theme.json
    file, I am curious whether it is possible to change fonts for particular UI components. Let's say I want to change the "quick fixes" or "context actions" popup menu to be rendered using a monospaced font, but not other menus, just popups that are invoked from the editor. Is it possible? I had some luck when I tried implementing a custom Look and Feel by extending
    DarculaLaf
    and setting font using
    defaults.put("PopupMenu.font", ...)
    . That way, popup menus are indeed rendered with monospaced fonts. However, manually registering a custom LaF does not take
    .theme.json
    into account because I think the theme provider, with a provided JSON file, somehow creates and registers the LoF instance internally. Darcula is also an old look, I want to make changes to the current modern Idea look. I tried several things with
    UIManager
    , like changing defaults for a
    currentLookAndFeel
    in
    StartupActivity
    , but that didn't work... If someone has some ideas on how to implement this, I would appreciate some help. Thanks! 🙏
  • a

    Anton Popov

    05/20/2024, 6:14 PM
    https://kotlinlang.slack.com/archives/CJLTWPH7S/p1716228760443749
  • r

    Renann

    06/15/2024, 10:14 PM
    Are there any good resources on how to build a plugin for a custom langauge by writing your Lexer/Parser from scratch? The official documentation seems to focus on grammarkit, but honestly it's still not sufficient 😞 ... dealing with BNF is non-trivial and it lacks documentation as far as I can see. Any resources, video, articles, pointers, etc would be of great help. Thank you.
  • w

    wwalkingg

    08/16/2024, 5:11 AM
    How can I runIde with new ui when i dev a plugin?
  • t

    Tobias Wohlfarth

    09/15/2024, 7:13 PM
    I'm new to the topic of intellij plugins and try to modify this plugin https://github.com/MaibornWolff/intellij-kotlin-builder-plugin/ Having an Instance of org.jetbrains.kotlin.psi.KtClass , how do i get the default values for parameters of the primary constructor?
  • f

    Francisco Noriega

    09/23/2024, 10:53 PM
    According to the IntUIKit, there should be some sort of toolbar dropdown component, that looks like the first image, however I've only managed to get the what appears on the second image by using
    ComboBoxAction()
    , which is what https://plugins.jetbrains.com/docs/intellij/toolbar-drop-down.html uses and even in the documentation it seems like there should be a way to make it show without the border and with the unfilled chevron. Anybody got any tips on how to get that style of dropdown out of the box?
  • f

    Francisco Noriega

    09/25/2024, 9:36 PM
    Similar to the last question, but anyone knows how to make a button show this little dropdown + a popup with this styling? (I've replicated it using a regular button and manually creating the popup with popupfactory, but the style is kind of different)
    b
    • 2
    • 2
  • r

    Ruslan A

    10/11/2024, 3:40 PM
    Hello. I'm trying to migrate my plugin to K2. In my plugin, I have a function for creating a gradle module with different functionality that adds import to a file located in the main module. For this, I have a line like ``ktPsiFactory.createImportDirective(ImportPath.fromString(moduleCanonicalName)``, but when I enable K2 mode, I get the error "is scheduled for removal because its signature references 'org. jetbrains. kotlin. resolve. ImportPath' scheduled for removal in a future version " on the
    createImportDirective
    and
    ImportPath.fromString
    functions. What is the current replacement for these functions? I searched, but did not find the correct replacement
    b
    j
    t
    • 4
    • 4
  • s

    Stijndcl

    10/20/2024, 11:15 AM
    I've been wanting to write a plugin that modifies run configs in a pretty generic way (does some things that apply to every single kind of RC, such as modifying parameters and environment). As far as I can tell from the docs, this can only be done using the run config extension point. Are there any other options? My issue is that the EP only exists for a small subset of languages and I wouldn't be able to support most kinds of RC's, and the python one is only available for Pythonid (pycharm professional) while my plugin doesn't need any pycharm pro-related functionality, so I'd like to make it available to community users as well. I get that there are some specific properties of run configs that require them to be separated, but the ones I'm interested in changing are available everywhere, and there are no extension points available for many other kinds of run configs (e.g. shell scripts, custom ones).
  • m

    Muhammed Hasan

    11/20/2024, 8:17 PM
    Plugin 'Kotlin Multiplatform' wasn't loaded because it's incompatible with the Kotlin plugin in "K2" mode
  • s

    Scott Fedorov

    12/11/2024, 12:22 AM
    Do we have sources available for Flora? It's referenced in the official docs but there's nearly zero information on it anywhere in the world. Even a search here doesn't yield many results.
  • t

    Timo Drick

    12/11/2024, 2:00 PM
    Hello everyone. I am currently developing a plugin using Compose. And i just wondering if it is possible to know if the IDE is in darkmode so i can use different color scheme. Or if it is possible to use the IDE color scheme. I know the sample code and it gets at least the background color of the IDE.
    a
    b
    c
    • 4
    • 22
  • s

    Stijndcl

    12/31/2024, 1:51 PM
    Are there any good resources to learn about making plugins for templating languages (e.g. Jinja2, Go templating, Tera, ASP, ...)? I found the official tutorial for regular languages, but templates seem to differ in some aspects. Most of the classes are never even mentioned in the docs which makes it hard to know what to do as well. Checked out some GitHub repos of existing plugins, but getting thrown into a massive pre-existing codebase is a bit overwhelming and doesn't help to understand what to actually do and in which order these things are created. They do however seem to all follow the exact same structure, even down to variable names, which suggests to me there is a resource somewhere that they're basing themselves off of. Mainly looking for something like the SimpleLanguage sample from the docs that starts from 0 and guides you through.
  • t

    Timo Drick

    02/01/2025, 8:01 PM
    My Intellij plugin does use Compose (Jewel) to render the UI. My question is how can i create a distributions version that will run on all supported platform like (linux/macos/windows x64/arm). Do i just have to add all dependencies like that:
    Copy code
    dependencies {
        implementation(compose.desktop.linux_x64)
        implementation(compose.desktop.linux_arm64)
        implementation(compose.desktop.macos_x64)
        implementation(compose.desktop.macos_arm64)
        implementation(compose.desktop.windows_x64)
        implementation(compose.desktop.windows_arm64)
    }
    Or is there a clever mechanism to create extra files for all platforms and deploy them to the Plugin marketplace?
    👀 2
  • t

    Timo Drick

    02/03/2025, 9:58 AM
    I do have an other issue. When IntelliJ is opened together with my plugin active (It is a fileEditorProvider -> TextEditorWithPreviewProvider). So a file is already opened from last session. My code is executed before the system is ready. I am not sure exactly what that means. But it is not indexing. It looks like that the project is not finished opening or s.th. like that. So my question is can i get the state of the IDE to be aware of if the project is currently opening?
    b
    • 2
    • 2
  • t

    Timo Drick

    02/17/2025, 9:25 AM
    I would like to use the Workspace Model instead of the Project Model in my plugin. But i still not able to get the output path where the classes are compiled for a module. I am using following Project Model code to get the classpath for a module:
    Copy code
    val rm = ModuleRootManager.getInstance(module)
    val classPath = rm
        .orderEntries()
        .classesRoots
        .map { it.presentableUrl }
    How could i get it in Workspace Model. I am already be able to get the path to all dependencies but i am missing the path to the classes generated by this module itself:
    Copy code
    module.dependencies
        .filterIsInstance<LibraryDependency>()
        .mapNotNull { currentSnapshot.resolve(it.library) }
        .mapNotNull { library ->
            library.roots.find {
                it.type == LibraryRootTypeId.COMPILED
            }?.url?.presentableUrl
        }
    My experiments with module.contentRoots and module.sourceRoots show that this do not contain the correct path just some intermediate folders where resources are generated.
  • d

    Draget

    02/18/2025, 7:10 PM
    There is this plugin to integrate a serial console into IDEA: https://plugins.jetbrains.com/plugin/8031-serial-port-monitor It is one of the several plugins that is published under the Jetbrains branding that does not publish any change-logs, which I had brought up two or three years ago, but whelp. What my actual issue is: This plugin is receiving multiple updates per month, per week and in the recent days even sometimes per day. And even worse: The associated git repository does not have any commits since over a month: https://github.com/JetBrains/intellij-plugins/tree/master/serial-monitor This does ring quiet a few security-related bells for me. Before I start bin-diffing and analyzing, does anyone know any possible explanation for this?
    b
    • 2
    • 13
  • b

    bod

    02/19/2025, 10:46 AM
    set the channel topic: Developing IntelliJ IDEA plugins? Feel free to ask any questions about migrating to K2 mode here. Also check out the JetBrains Platform forum: https://platform.jetbrains.com/
  • b

    bod

    02/27/2025, 8:47 AM
    you need to do something like here and pass a
    localPath
    for example that's what we do:
    Copy code
    tasks {
      val runLocalIde by intellijPlatformTesting.runIde.registering {
        // Use a custom IJ/AS installation. Set this property in your local ~/.gradle/gradle.properties file.
        // (for AS, it should be something like '/Applications/Android Studio.app/Contents')
        // See <https://plugins.jetbrains.com/docs/intellij/android-studio.html#configuring-the-plugin-gradle-build-script>
        providers.gradleProperty("apolloIntellijPlugin.ideDir").orNull?.let {
          localPath.set(file(it))
        }
    }
    k
    • 2
    • 13
  • w

    wwalkingg

    03/10/2025, 8:52 AM
    Sorry to bother you all, I would like to ask if IntelliJ Community will include the Compose runtime soon?
    • 1
    • 1
  • e

    Emre

    03/14/2025, 3:14 AM
    What metadata does IntelliJ Ultimate's Redocly OpenAPI generator recognize in Kotlin? Is there a way to provide examples, or to describe parameters?
  • m

    Michael Friend

    03/21/2025, 5:17 PM
    EDIT: Turns out i was using a 1.x version of the sdk since i created it from the wizard instead of the template which is probably the issue. migrating now which im guessing will fix it Im having issues getting a service created with a
    CoroutineScope
    . I added a coroutinescope constructor parameter to my service just like the docs say, but once i do that my call to `service()`/
    ApplicationManager.getApplication().getService
    give an error
    Cannot create class
    . I get the same error when trying to add
    Project
    in the constructor as mentioned in other parts of the docs. what am i doing wrong here?
    • 1
    • 3
  • y

    Youssef Shoaib [MOD]

    03/22/2025, 6:47 AM
    How do I declare that my
    FoldingDescriptor
    depends on Analysis API results? Do I have to try and get the PSI out of the references I grab? I'm guessing
    reference.psi
    would be sufficient?
  • y

    Youssef Shoaib [MOD]

    03/22/2025, 8:51 AM
    Is there a way for me to invalidate all my custom
    FoldingDescriptors
    in a file upon the file changes? Adding a dependency on
    currentFile
    does not seem to work
    • 1
    • 1
  • m

    Michael Friend

    03/24/2025, 3:45 PM
    Has anyone run into issues trying to use Ktor in a plugin project? I have a project thats basically just the github template but i added a coroutine scope to
    MyProjectService
    which works, but when i add any ktor dependencies it fails to resolve the service at run time with this error even though my service has a
    Project, CoroutineScope
    constructor. Here's a repo to reproduce the issue https://github.com/mrf7/ide-plugin
    Copy code
    Caused by: com.intellij.platform.instanceContainer.instantiation.InstantiationException: Class 'class com.github.mrf7.ideplugin.services.MyProjectService' does not define any of supported signatures '[(Project)void, (Project,CoroutineScope)void, (CoroutineScope)void, ()void]'
    b
    • 2
    • 5
  • y

    Youssef Shoaib [MOD]

    03/30/2025, 1:37 AM
    Is there any way I can set a custom colour for a programmatically-created folding region? In particular, my folding regions span just an identifier, so I'd like to colour them in the same way that the underlying identifier would be coloured. Is that possible at all?
  • s

    Subash K

    04/12/2025, 7:33 AM
    Hi everyone! I’m working on a custom IntelliJ plugin UI and I noticed that
    com.intellij.toolwindow.StripeButtonUI
    is used internally for rendering tool window buttons. I understand it's not part of the public API, but I was wondering: Is it safe (or acceptable) to indirectly rely on
    StripeButtonUI
    for visual consistency, without explicitly referencing it in code?
    For example, mimicking its styles or letting the platform render components that use it under the hood. I want to make sure my plugin stays compatible and follows best practices. Appreciate any insights or recommendations on handling this kind of UI consistency without crossing into unsupported/internal API territory. 🙏
  • l

    Leo Podmolik

    04/15/2025, 5:09 PM
    Hi all, I am trying write some plugin by LivePlugin in ma Android project ... but looks like something i am missing because I haven't highlited code or suggestion for imports in plugin.kts ... even when I try it in AndroidStudio or IntelliJ IDEA ... does anybody similar problem ?
  • m

    Michael Friend

    04/24/2025, 6:33 PM
    Does anyone have a working example of persisting state/settings in a plugin? I followed the docs and even just copy pasted the example into my project and i still get this warning that the state cant be serialized and the values arent persisted across reset
    WARN - #c.i.u.x.Binding - No accessors for intellijplugin.toolWindow.tabs.MySettings$State. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
    👀 1
    t
    • 2
    • 1
  • n

    natpryce

    04/27/2025, 12:45 PM
    How do I now specify the jvmToolchain in subprojects? My Gradle build does this:
    Copy code
    subprojects {
      ...
      plugins.withType<KotlinPlatformJvmPlugin> {
        kotlin {
          jvmToolchain(21)
        }
      }
    }
    But the KotlinPlatformJvmPlugin class no longer exists in the plugin for Kotlin 21.1.20, and the KotlinJvmPlugin class is internal and cannot be referenced from build scripts.
    h
    • 2
    • 3