https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
intellij
  • j

    julioromano

    01/27/2022, 12:54 AM
    My ide started to show all Java imports in a kotlin project as red. It's for sure a false alarm because the build is fine. Invalidating caches didn't solve it. Can someone offer any hint on how to try to debug such issues? I don't even know where to start (it's a gradle multi project build).
    ✅ 1
    a
    o
    c
    • 4
    • 5
  • c

    christophsturm

    01/27/2022, 7:27 PM
    first thought when i saw a new IDEA EAP announced on twitter: “I wonder what ancient kotlin version it will use.” now i know the answer. 1.5.10.
    😂 2
    ⁉️ 1
    😢 9
    🤦‍♂️ 1
    a
    m
    • 3
    • 4
  • k

    Karlo Lozovina

    02/02/2022, 6:49 PM
    Why is Intellij giving this hint? Does it prefer I remove the
    ==
    check, and just leave the
    else
    branch?
    c
    h
    a
    • 4
    • 7
  • t

    Tom Haywood

    02/03/2022, 12:38 AM
    If I have a simple one line function e.g.
    fun foo() = "hello"
    And I want to change this to have a body, because I need to add more lines. e.g
    fun foo(): String {
        return "hello"
    }
    Is there a refactoring that can do it for me?
    k
    f
    • 3
    • 3
  • s

    Skolson5903

    02/08/2022, 12:53 AM
    I'm using Idea Ultimate 2021.3.2 and running a native unit test, and for some reason the gradle task macosX64Test is showing no stdout stuff from the unit test, just gradle-level messages. Strings from a println() are just not displayed at all, and text from an assertEquals failing is also not shown. Run window just indicates the test either failed or succeeded, making the unit test not very useful :-). Anyone else having trouble seeing stdout in the Run window during native unit tests?
    a
    • 2
    • 5
  • m

    mcpiroman

    02/09/2022, 7:51 PM
    If I open a .class file that was compiled from kotlin, IJ tries to decompile it as a kotlin, although
    // Implementation of methods is not available
    How do I disable that and use standard java decompiler/bytecode viewer? (the option `Show bytecode`is also disabled right now).
    a
    • 2
    • 8
  • a

    Ayfri

    02/15/2022, 4:25 PM
    Hi, why does showing class diagram is not available for external definitions in a Kotlin/JS project ?
    a
    • 2
    • 1
  • t

    Tomas Kormanak

    02/15/2022, 8:19 PM
    Hi, I have an issue with auto adding imports, which is really annoying. It automatically adds import and prefix variables it in the rest of file, for example: When I have a code:
    class (
     val email:String
    ) {
    
    fun doSomething() {
       print(email)
    }
    Then I decide not to define property
    email
    in constructor and remove
    val
    , IDEA automatically change all occurrences of
    email
    like this:
    import kotlinx.html.InputType
    
    class (email:String) {
       fun doSomething() {
          print(InputType.email)
       }
    }
    I am facing it in lot of similar cases, usually related to enums. I have option `Editor->General->Auto Import->Add unambiguous imports on the fly`disabled.
    a
    a
    • 3
    • 6
  • n

    nat

    02/23/2022, 12:57 AM
    Hey folks, I'm wondering if anyone else has seen a similar issue where IntelliJ doesn't recognize some Kotlin/ktor code that compiles fine. For example in my screenshot it complains about a type mismatch yet this code compiles and runs fine, and was just based on some examples from the ktor client docs. Does anyone have any advice for figuring out this issue or tracking down why this happens in IntelliJ? I am running IntelliJ IDEA 2021.3.1 with openjdk-17 and Kotlin 1.6.10. Please let me know if there is a better place to ask questions like this as well. Screenshot in thread
    a
    • 2
    • 2
  • k

    Klitos Kyriacou

    02/24/2022, 11:24 AM
    Hi, I've created a Maven project which uses Kotlin and does not use Lombok, but when I open it I get the warning "Lombok requires enabled annotation processing: Do you want to enable annotation processors?". Searching every file in the project for "lombok" returns no results. Is this a known issue?
    a
    • 2
    • 1
  • s

    smallufo

    02/26/2022, 4:08 PM
    Hi , does IntelliJ performs better on M1(pro|max) than M1 ? I know pro|max performs much better than M1 on job of video editing or gaming, but I don’t do that. I just a developer , with tools of IntelliJ / Java / Kotlin / docker (and maybe android dev in the future) … etc. I am using M1 mini now , and it performs well. But for laptops , are there any performance differences among M1/Pro/Max (with same 16G ram) ?
    p
    • 2
    • 3
  • r

    rkeazor

    03/05/2022, 3:52 PM
    Is there a way to update the Android Support Plugjn for Intellij ?
    m
    h
    • 3
    • 4
  • s

    simon.vergauwen

    03/08/2022, 2:29 PM
    Does anyone know if it's possible to use
    ReplaceWith
    to refactor a
    package
    ? In Arrow we need to migrate a DSL to a new package, but
    ReplaceWith
    seems to be broken. https://github.com/arrow-kt/arrow/blob/main/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/either.kt#L109
    a
    • 2
    • 2
  • s

    sbyrne

    03/08/2022, 8:44 PM
    I have two Kotlin Gradle projects open in a single Idea project.
    MyApp.kt
    in Gradle project A imports
    MyLib
    from Gradle project B. If, from
    MyApp.kt
    I do "Go To -> Declaration or Usages" on
    MyLib
    , should it open
    MyLib.kt
    in project B? Currently it opens up a decompiled bytecode. This worked with Maven, but Idea does not seem to be making the connection between Gradle projects.
    • 1
    • 1
  • r

    rocketraman

    03/10/2022, 4:06 PM
    It's possible to search for usages of a data class constructor by positioning the cursor inside the constructor brackets and using "Find Usages". However, this doesn't work for value classes. Is this a known issue? Not seeing anything related in YouTrack.
    • 1
    • 1
  • m

    mbonnin

    03/23/2022, 10:43 AM
    Anyone knows how IntelliJ picks up my JAVA_HOME? Looks like it's able to pick up what I put in
    .zshrc
    even though it's not (always) started from the command line? Am I just lucky or do "graphical" apps also inherit the shell env variables somehow on MacOS?
    s
    e
    • 3
    • 7
  • h

    hfhbd

    03/24/2022, 11:49 AM
    Using Datagrip or IJ Ultimate with datagrip plugin: Is it possible to write custom sql extractor plugins/scripts in Kotlin? Current documentation only mention groovy (or JavaScript)?
    • 1
    • 1
  • n

    napperley

    03/29/2022, 2:15 AM
    Is the issue of the source code not being shown on demand going to be sorted during one of the Kotlin 1.6.x releases? When using ctrl+b on an element in a Kotlin source file only the metadata is shown, eg:
    // IntelliJ API Decompiler stub source generated from a class file
    // Implementation of methods is not available
    
    package io.gitlab.embedSoft.lvglKt.core.lvglObject
    
    public final enum class LvglPart private constructor() : kotlin.Enum<io.gitlab.embedSoft.lvglKt.core.lvglObject.LvglPart> {
        MAIN,
    
        SCROLLBAR,
    
        INDICATOR,
    
        KNOB,
    
        SELECTED,
    
        ITEMS,
    
        TICKS,
    
        CURSOR,
    
        CUSTOM_FIRST;
    }
    a
    • 2
    • 2
  • c

    christophsturm

    03/29/2022, 7:34 AM
    I wonder if for kotlin projects go to class should also find top level functions and top level values. (it could be renamed to go to top level object) I know that i can use go to symbol, but that finds way more things.
    ➖ 1
    e
    r
    • 3
    • 10
  • a

    Ayfri

    04/08/2022, 10:45 AM
    Hi, simple question, when opening a folder 1 containing only a sub-folder 2 with code, is there a way to directly open the sub-folder 2 with the code as the folder 1 doesn't contains anything appart the sub-folder 2 ?
    c
    • 2
    • 1
  • t

    Tom Dyas

    04/12/2022, 2:29 PM
    Is the Kotlin code formatter used in the IntelliJ plugin available as a separate jar on Maven Central?
    c
    s
    • 3
    • 7
  • k

    Klitos Kyriacou

    04/13/2022, 9:03 AM
    For a Maven project, when right-clicking pom.xml and selecting "Show effective POM", is it possible to get it to show which parent POM a certain line comes from?
    • 1
    • 1
  • d

    dimsuz

    04/14/2022, 11:17 AM
    No longer seeing "Put arguments on different lines" action. Only when line is too long, but I very often want to apply this action when line is less then wrap width (for example when working with Compose). Is it some bug or something configurable? (can't find where)
    w
    • 2
    • 3
  • b

    Brian

    04/15/2022, 5:16 PM
    Something I've been noticing since Kotlin 1.6.20 in IJ is that building the project now seems to use Ant rather than Gradle, even though the project's build script is
    build.gradle.kts
    . Why is that?
    a
    • 2
    • 4
  • n

    napperley

    04/21/2022, 1:35 AM
    Code completion seems to be broken when using Kotlin 1.6.21 with the linuxX64 target (may also be a problem with the other Linux targets). For example, in the platform.linux package only a single function is listed (mq_open - https://man7.org/linux/man-pages/man3/mq_open.3.html ) with most of the other items being constants (like KDSETMODE for example). If some other symbol (eg mq_send - https://man7.org/linux/man-pages/man3/mq_send.3.html ) has its import inserted by IntelliJ (via Alt+Enter) then that symbol now appears in the code completion list.
    a
    • 2
    • 2
  • d

    darkmoon_uk

    04/22/2022, 4:48 AM
    Is there a way to populate 'Favourites' from Gradle configuration? Use case: Our project module structure enforces '_Clean architecture_' so that each major feature module contains a '_Presentation_', '_Domain_', and '_Service_' sub-module. While this has its benefits; a down-side is ergonomic navigation between files of the feature in the IDE, due to all the intervening
    /src/main/kotlin
    folder cruft etc. A code-defined, custom project view that presents the presentation/domain/service packages beside each other would resolve this problem. Favourite list provide a good enough User Experience, but AFAIK they can't be populated by Gradle code, so can't live alongside the code and be shared with the team. Any solutions?
    e
    • 2
    • 2
  • r

    rkeazor

    04/24/2022, 3:40 PM
    Is it not possible to create a Gradle based Kotlin Module , in intelij idea 2022? it seems to only default to Intelij build system
    m
    • 2
    • 2
  • d

    darkmoon_uk

    04/25/2022, 4:07 AM
    Can I debug the compilation process? I've set these options in
    gradle.properties
    and attached the debugger after run:
    org.gradle.debug=true
    org.gradle.debug.server=true
    org.gradle.debug.suspend=true
    ...but for some reason the debugger doesn't 'break' on this Exception which is occurring in a JS build:
    e: java.lang.AssertionError: Assertion failed
    	at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsAstUtilsKt.translateCallArguments(jsAstUtils.kt:341)
    I have previously used the debugger successfully to debug Gradle sync issues using the same method... is there something going on with internal process launching that's 'hiding' the JS compiler's activity from the debugger?
    e
    • 2
    • 2
  • r

    ribesg

    04/25/2022, 12:42 PM
    Anyone else’s IDE won’t import
    kotlinx.serialization.Serializable
    or is it just me? When I type
    @Serializable
    and autocomplete it it writes
    @kotlinx.serialization.Serializable
    instead of importing it. Doesn’t do it for any other class/annotation. Then if I try to hit
    Alt+Enter
    on it, it doesn’t offer to add the import there either. Weird
    m
    c
    z
    • 4
    • 17
  • z

    zeugederunity

    04/27/2022, 7:04 AM
    Hello everyone, can someone explain to me why I get a
    unresolved reference: kotlinx
    in this minimal working example? https://github.com/FelixEngl/mwe1 I tried everything I could think of and nothing seems to work. :/ I think this is a bug in the IDE or the IntelliJ-Kotlin-Plugin, but I don't know exactly what is causing it. (Because it compiles perfectly fine, so this shouldn't be a problem of the Kotlin MPP-Gradle-Plugin.) Thank you in advance!
    • 1
    • 1
Powered by Linen
Title
z

zeugederunity

04/27/2022, 7:04 AM
Hello everyone, can someone explain to me why I get a
unresolved reference: kotlinx
in this minimal working example? https://github.com/FelixEngl/mwe1 I tried everything I could think of and nothing seems to work. :/ I think this is a bug in the IDE or the IntelliJ-Kotlin-Plugin, but I don't know exactly what is causing it. (Because it compiles perfectly fine, so this shouldn't be a problem of the Kotlin MPP-Gradle-Plugin.) Thank you in advance!
Update: created an issue https://youtrack.jetbrains.com/issue/IDEA-293152/IntelliJ-can-not-resolve-MPP-references-in-common-code
View count: 1