https://kotlinlang.org logo
Docs
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
  • h

    holgerbrandl

    12/03/2021, 7:38 AM
    When debugging suspendable functions, it often says "optimized out" for variables I'd like to see. Is there a way to adjust/disable this type of optimization for debugging purposes?
    a
    • 2
    • 2
  • e

    edwinRNDR

    12/09/2021, 12:46 PM
    Is this the place to discuss this feature?
    👍 1
    j
    • 2
    • 2
  • r

    Rob Elliot

    12/09/2021, 3:01 PM
    Anyone from the IntelliJ team here? I’m getting endless ERRORs in the log from the Kotlin plugin 1.6.10-RC1 with 2021.3. I’m pressing “report” in the IDE, but when I search youtrack I don’t find them. Are you aware of them? Don’t want to raise duplicate issues unnecessarily.
    p
    a
    c
    • 4
    • 7
  • m

    Michael Böiers

    12/09/2021, 7:09 PM
    This looks like a bug to me - but is it in the Kotlin compiler, or IDEA, or both? https://pl.kotl.in/Ry0Q76YWi Using flatMap inside buildList makes the compiler flag accessing the Pair components due to some ambiguity. When I specify the type explicitly (buildList<…>), then it works, but IDEA flags the explicit type as redundant and unnecessary. Seems like two distinct bugs …
    a
    • 2
    • 1
  • r

    Richard Gomez

    12/10/2021, 4:53 AM
    Is it just me, or is IntelliJ displaying "less than or equal to" for both sides of a range? I'm pretty sure the left side is meant to be "greater than or equal to".
    f
    e
    +2
    • 5
    • 11
  • h

    hfhbd

    12/13/2021, 12:11 PM
    Is there some option/visualization to understand why IntelliJ says this check always results into `true`/`false`?
    a
    c
    • 3
    • 6
  • n

    napperley

    12/15/2021, 12:10 AM
    @Alexey Belkov [JB] - With the updated version of the Kotlin plugin the IDE freezes (chokes) when pasting in a large amount of data for an Array 😦. The IDE will also freeze when using the Quick Documentation function (Ctrl+q). Here is the data that is being used: https://github.com/lvgl/lv_demos/blob/master/src/lv_demo_widgets/assets/img_lvgl_logo.c Making even minor changes to the Kotlin source file after using the large amount of data causes the IDE to freeze 😱. These issues don't occur with the previous version of the Kotlin plugin.
    h
    w
    +2
    • 5
    • 12
  • h

    holgerbrandl

    12/15/2021, 7:47 AM
    Not sure, if there is a better channel, but I'd like to argue the style default to add whitespace before if, when and for. Why is that? Nowhere else in kotlin is a whitespace used before a round bracket. The difference between keyword and function call is IMHO so fuzzy, because users can and will express very similar constructs enabled by https://kotlinlang.org/docs/lambdas.html#passing-trailing-lambdas which is reformatted inconsistently (using default setting):
    fun myIf(condition: Boolean, block: () -> Any) {
        block()
    }
    
    fun main() {
        if (true) {
            println("foo")
        }
    
        myIf(true) {
            println("bar")
        }
    }
    And yes, I know how to change the default. But I'd rather like to see consistency in the formatting, and would love to upvote some kepp/tickeet to change the default.
    ➕ 2
    e
    e
    • 3
    • 10
  • m

    Miguel Vargas

    12/15/2021, 5:51 PM
    I find the
    CanBeParameter
    inspection annoying. That’s the one that warns when you can remove
    val
    from a constructor param. As I move code around in a class I’m having to arbitrarily change wether I need
    val
    or not. But as far as I can tell there is no benefit for private vals. Before I disable the inspection i’m wondering what am I missing?
    e
    j
    • 3
    • 9
  • j

    jwass

    12/17/2021, 12:47 PM
    This is such a basic thing. But every time I run code coverage the panel shows at the root level (showing all loaded packages) and I only care about the project I’m working on. Is there a way of bookmarking my package name rather than having to navigate to it each time? I couldn’t see anything in the preferences.
    ➕ 3
    w
    • 2
    • 2
  • c

    Colton Idle

    12/19/2021, 5:12 PM
    Do we know what version of intellij is supposed to support Android Gradle Plugin 7+?
    m
    h
    • 3
    • 10
  • v

    Vitali Plagov

    12/21/2021, 7:19 PM
    Getting so many of these errors with the latest Kotlin plugin… 😞
    ➕ 12
    m
    p
    +2
    • 5
    • 8
  • m

    MrNiamh

    12/27/2021, 9:24 AM
    👋 I have a typealias for a Long, when I use it elsewhere and have intellij autocomplete it, it will sometimes add a comment after with its actual type (see picture). Is there a way to turn that off?
    a
    • 2
    • 3
  • v

    Vitali Plagov

    12/28/2021, 3:49 PM
    Does the Kotlin plugin in IDEA supports the feature to pass in all the method’s parameters to another method, that is called? I think it works for Java, but not sure it’s available for Kotlin. For example:
    fun foo(a: Int, b: String, c: Boolean) = /*...*/
    
    fun bar(a: Int, b: String, c: Boolean) {
      /* some work */
      foo( // I press the ctrl+space here to show the code completion. Ideally would be to give an option to pass it to foo() all arguments of the bar()
    }
    e
    a
    • 3
    • 2
  • a

    Ayfri

    12/30/2021, 12:53 AM
    Hi, I'm trying to use the Structural Replace tool to create an inspection to replace an object to a class with a companion object containing the original object fields, but I don't understand what is the problem here ?
    b
    • 2
    • 2
  • a

    Ayfri

    01/03/2022, 7:58 AM
    Hi, how can I put code block to custom inspections made in the editor ?
    b
    • 2
    • 4
  • m

    mbonnin

    01/03/2022, 5:47 PM
    Where can I find a list of all IntelliJ EAPs? I clicked "update" in toolbox but looks like things that were working before are not anymore. I'd like to try the previous EAP but can't find it anymore
    c
    • 2
    • 4
  • c

    Colton Idle

    01/04/2022, 10:04 PM
    Is there a way in intellij to generate javadocs for a method? i.e. When I start typing
    /**
     * 
     */
    I want it to auto fill the param names
    v
    c
    +2
    • 5
    • 10
  • a

    Ayfri

    01/05/2022, 11:14 AM
    It could be great to have an inspection that will search for functions/methods invocation but if an argument has a value that is equal to the default value from the signature, suggest to remove this argument from the invocation
    b
    a
    • 3
    • 2
  • s

    scarf

    01/13/2022, 7:59 AM
    hi, it takes me ~3 minutes to compile one-line program like helloworld.kt, and it lags every time i press a key. i'm using intellij ultimate without any changes from installation (ubuntu 21.10, kde, 16gB ram, ryzen 4700u). is this normal?
    k
    r
    r
    • 4
    • 4
  • c

    Colton Idle

    01/14/2022, 12:52 PM
    Is there any timeline for intellij being able to be compatible with Android Gradle Plugin 7+? The last time I asked someone said in 2021.3 but it still isn't available (i.e. I opened an AGP 7+ project in Intellij and it gives me an error saying that it's not compatible with 7+)
    j
    s
    • 3
    • 7
  • r

    rrva

    01/17/2022, 6:01 PM
    I am full of anticipation to try k2 compiler for the IntelliJ code analysis. Real builds would still use kotlin stable via gradle. Is this possible today?
    c
    • 2
    • 1
  • l

    leandro

    01/18/2022, 3:56 PM
    What happened to the template to create a multiplatform “app”? There’s only library, then “Native application” and “Full-Stack Web Application”. I remember one having Android, iOS, and web.
    k
    • 2
    • 2
  • i

    ianbrandt

    01/19/2022, 1:21 AM
    I notice there's a new 1.6.10 Kotlin Plugin build, 213-1.6.10-release-923-IJ5744.223 -> 213-1.6.10-release-944-IJ6461.79. What changed? The linked change log is just for 1.6.10 in general.
    a
    • 2
    • 2
  • s

    Sourabh Rawat

    01/23/2022, 2:02 PM
    Hi, why can't I see my arguments passed for my gradle run task?
    h
    • 2
    • 3
  • w

    wasyl

    01/23/2022, 3:45 PM
    What does IntelliJ use https://github.com/JetBrains/intellij-community/blob/master/jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildMain.java for? I see a java process running this class with different JDK than the IntelliJ itself/Gradle has set (the
    BuildMain
    is started with JDK 11, the rest with JDK 17) and I wonder what might be affected (It’s on Android Studio so I need to check where to report this mismatch)
    a
    • 2
    • 3
  • d

    Draget

    01/24/2022, 9:24 PM
    Honest question for those who use CodeWithMe: Does anyone use it regularly without it completely braking after a few minutes or with certain actions? Symptoms like: • One guest selecting multiple lines via mouse-drag causing a dozents of seconds long flickering one-character-at-a-time mess on the host? • Guests creating files - in 90% of the cases not working or appearing in wrong places/names • Ctrl-Z commands when Host and Guest do them, suddenly completely nuking the file and merging old and incorrect fragments randomly into a mess? • Despite good internet connection, syncing issues that cause changes to be delays several dozents of seconds. I have been trying CWM somewhat regularly from the very first beta and also use it with the latest release right now. But when I use it, we know: Never select using your mouse, only the host can ever create/move/delete files, better not move files at all and when doing Ctrl+Z anywhere, tell everyone to stop working, carefully do it and wait for it to sync. It is hard to belive for me that our company is the only one who has these effects.
    f
    c
    • 3
    • 3
  • k

    Klitos Kyriacou

    01/25/2022, 10:14 AM
    I've just noticed that the Kotlin REPL in both 2021.2.4 and 2021.3.1 doesn't output the same things as the command-line kotlinc shell: in IntelliJ,
    println('a');println('b')
    outputs
    ab
    instead of separate lines. Is this a known issue?
    • 1
    • 1
  • k

    kevin.cianfarini

    01/25/2022, 3:11 PM
    Can anyone explain what this type hint in intellij means?
    m
    k
    a
    • 4
    • 12
  • c

    Colton Idle

    01/25/2022, 7:44 PM
    I run some junit4 tests in intellij (i have an android/gradle project, but the tests are from a java only module). Is it possible in intellij to package these tests up into a command line app so that I could run it on a server (i want to pipe the results into a slack bot for example). I'm still new to the world of unit testing and so the results in the IDE are great, but I really want to run them from cmd line (esp through a pre-built jar)
    :not-kotlin: 1
    j
    • 2
    • 4
Powered by Linen
Title
c

Colton Idle

01/25/2022, 7:44 PM
I run some junit4 tests in intellij (i have an android/gradle project, but the tests are from a java only module). Is it possible in intellij to package these tests up into a command line app so that I could run it on a server (i want to pipe the results into a slack bot for example). I'm still new to the world of unit testing and so the results in the IDE are great, but I really want to run them from cmd line (esp through a pre-built jar)
:not-kotlin: 1
j

Javier

01/25/2022, 7:53 PM
your server can run the tests via Gradle tasks which will generate report files that you can upload to whatever web/slack
try running
./gradlew check
and check the
reports
directory in the
build
directory of each module
c

Colton Idle

01/25/2022, 8:03 PM
Thanks. That's definitely better, but would love to just have that artifact available instead of compiling again. But this might work for now. For anyone following along, if you have other ideas about how to run it as a jar. please let me know. 😄
j

Javier

01/25/2022, 9:46 PM
Not sure what you want to get but is it not easier to setup a CI like github actions so every time you create a PR you can comment the result of that PR in slack passing tests result, coverage, lints, etc?
💯 1
View count: 1