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
  • s

    sreich

    06/24/2022, 7:58 PM
    how do i use intellij's search & replace templates to take a statement and turn it into a fixed statement expression. It just says expressions aren't allowed. Do i need to wrap it in quotes? e.g. search is
    @Slf4j
    , replace is
    val log = KotlinLogger {}
    . how do i get that result?
  • s

    sreich

    06/24/2022, 8:17 PM
    specifically i get,
    a non-expression cannot be replaced with an expression
    e
    • 2
    • 11
  • n

    Norbi

    06/24/2022, 9:16 PM
    Is it somehow possible in Idea to somehow automatically stop the Gradle daemons when the build is completed? I use Kotlin, and starting a Gradle daemon takes minor time (~1s) compared to the Kotlin compilation (from several seconds to lots of seconds). But sometimes the Gradle daemon keeps locking some files that makes the Idea build fail. Only stopping the daemons explicitly solves the problem (by
    gradlew --stop
    ). I use Gradle 7.4.2. Thanks!
    w
    • 2
    • 1
  • r

    rrva

    06/27/2022, 9:51 AM
    Can IntelliJ show unused fields of data classes automatically? Are there annotations etc that prohibit this?
    s
    s
    • 3
    • 3
  • s

    sreich

    06/27/2022, 5:11 PM
    i'm having an issue with intellij not importing my settings (2022.1.3). i will export a settings, remove my custom live template. i see the exported zip file has the template. Then i import the templates and they're not in the settings, after it restarts. I even tried doing a full settings export/import. I am on enterprise and syncing with the intellij sync feature. It's possible there could be a permission issue, that's the only thing i can think of. How can i troubleshoot this?
  • s

    sreich

    06/27/2022, 8:04 PM
    it seems that Kotlin Intellij live templates no longer have the following variables:
    functionParameterTypes()
    ,
    functionParameters()
    . Is this true? They are returning empty when I try porting a java template to kotlin. I do not see them in the dropdown, what can I use instead?
  • s

    sreich

    06/28/2022, 3:49 PM
    I submitted an issue for this, https://youtrack.jetbrains.com/issue/IDEA-297014/Intellij-Kotlin-Live-Templates-Search-Replace-methodParameterTypes-missing-from-Java
  • m

    mcpiroman

    06/30/2022, 9:35 AM
    Were you ever disappointed there is no `clamp`function in kotlin? There is but it's named
    coeraceIn
    . Or there is no
    exists
    ? Its named
    any
    . I highlight this, IMO overlooked, proposal would help in such situations.
    👎 4
  • j

    Jolan Rensen [JetBrains]

    07/04/2022, 1:50 PM
    I'm having some issues with having IntelliJ play nice with Java Comment Preprocessor. Since I'm using a multi-module project I need to set the kotlin/scala sources to the preprocessed folder so other modules use the right sources. However, when (re)importing the project intelliJ continuously sets the preprocessed folder in build as sources root instead of the normal
    src/main/kotlin
    , making IntelliJ stop giving hints. Is there a way to change the sourcesets in gradle while keeping the source root markings of IntelliJ as they were? I have a sample project (actually built for something else) which has this issue. I marked it in TODOs for instance here. I did an attempt with
    idea.module {}
    in
    build.gradle.kts
    but that didn't seem to do anything except from giving me duplicate content roots... Any tips? I was personally thinking I could maybe set the source folders back after building/deploying or something , but I also couldn't figure out how to do that...
    o
    • 2
    • 37
  • k

    kotlinforandroid

    07/05/2022, 8:41 AM
    I have trouble running Shared Indexes plugin on Android Studio 2022.2.1. I have an active license but the plugin always reports that
    intellij.indexing.shared.core
    is missing/not activated. It is not listed under
    disabled_plugins.txt
    . In fact, that file does not even exist. Running Linux (NixOS).
  • s

    Stylianos Gakis

    07/05/2022, 11:04 AM
    I’ve seen arguments about using tabs instead of spaces in code editors in order for people to freely pick for themselves if a tab would take 2 spaces or 4 spaces. Basically so that each team member can pick the one of their liking of how the code shows on their IDE. I however can’t seem to find where such an option would be inside IntelliJ. Does it exist, and if yes how would I go about editing it, has anyone got any experience with such a thing?
    k
    s
    s
    • 4
    • 13
  • s

    sreich

    07/07/2022, 6:23 PM
    i'm trying to get this as an inspection to suggest to replace StringUtils.isEmpty(myvar) with myvar.isEmptyOrNull(). Works great...except, it does not delete the StringUtils part preceding it. Why is this, and how can I fix it so it does?
    r
    • 2
    • 2
  • s

    sreich

    07/08/2022, 12:45 PM
    I have a search template of
    $Before$.$MethodCall$($Parameter$)
    , problem is..it matches on
    <http://log.info|log.info> { }
    as well as
    <http://log.info|log.info> ()
    , how can i get it to not match on lambda? I set complete match but it still doesn't listen to me, i want it to take the parentheses as is
    r
    • 2
    • 16
  • v

    v79

    07/12/2022, 6:21 AM
    I have a simple Kotlin/Gradle project. I'd like to make it a bit more complicated and add a new module in IntelliJ. File > New > Module... Kotlin isn't one of the listed language choices! Any thoughts as to what I've done horribly wrong? This is IntelliJ Ultimate 2022.1.3 and the parent project is definitely Kotlin.
    a
    • 2
    • 2
  • r

    rrva

    07/12/2022, 3:26 PM
    is there a standardized IntelliJ benchmark to test different hardware/OS configurations ? Which builds a test realistically sized java or kotlin project, triggers some common tasks etc.
    k
    • 2
    • 1
  • m

    Mikhail

    07/17/2022, 11:28 PM
    is this the future of integrated development environments?
    😢 1
    b
    • 2
    • 3
  • m

    Mikhail

    07/18/2022, 9:54 AM
    No idea why does intellij submit a single report ('Report and Clear') three times. Running IntelliJ IDEA 2022.2 Beta (Ultimate Edition)
    • 1
    • 1
  • o

    Oliver.O

    07/18/2022, 10:42 AM
    Is it just me or do you also think IntelliJ auto-generating import statements for symbols in the same file is somewhat weird? Example in 🧵.
    • 1
    • 2
  • m

    mkrussel

    07/18/2022, 6:59 PM
    I just installed intellij 2022.1.3 CE to use instead of Android Studio to see if it handled KMM better. When opening my project I get
    This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 2021.1.1 or newer.
    I assume 2022.1.3 is newer than 2021.1.1 Anyone know what I need to do to resolve this, or can I ignore the import error.
    m
    r
    • 3
    • 10
  • m

    Marian Schubert

    07/19/2022, 7:38 AM
    Sometimes when I do refactoring like rename/delete/create class field/constructor parameter I get compilation errors that I don't call constructor with right parameters even that I/IDEA did update all call sites correctly. IDEA thinks that everything is OK (which it is) in editor, but when I run tests or compilation I get these compilation errors. Calling
    gradle
    from command line also works, and it does not fail with these errors. Does this happens to anyone else?
    t
    • 2
    • 1
  • p

    Piotr Krzemiński

    07/19/2022, 11:27 AM
    I'm importing a class that sits in such Kotlin package: `import it.krzeminski.githubactions.actions.`8398a7`` . The problem is that at some moments, IntelliJ "simplifies" the import to
    import it.krzeminski.githubactions.actions
    . Looks like a bug - has anyone encountered it?
  • m

    Mikhail

    07/19/2022, 10:37 PM
    What about including
    Reload all Gradle projects
    into
    Repair IDE
    ?
  • p

    phldavies

    07/20/2022, 3:25 PM
    Are there any tips to improve the intellij terminal performance? Using tui tools like
    tig
    or
    k9s
    are almost unbearably slow (even
    vim
    can be at times)
  • n

    Nitin Karthy

    07/21/2022, 4:03 PM
    Is there a way to make Code Completion in Idea to show the properties and methods of the receiver when inside a lambda with receiver and there is nothing typed at the cursor? This would be very useful in exploring DSL APIs in the IDE.
    b
    • 2
    • 2
  • v

    Victor Cardona

    07/23/2022, 6:37 PM
    Is anyone else having trouble creating a Kotlin JVM Gradle project in IntelliJ 2022.1.4 using Kotlin Plugin 221-1.7.10-release-333-IJ5591.52? When I create one via the New Project Dialog it generate the project but in Kotlin files at the top of the editor it says Kotlin is not configured. Configuring Kotlin by clicking on the link has no effect. Also, none of the project dependencies are showing in the project window under External Dependencies, but they are listed in the Gradle window.
    • 1
    • 1
  • m

    Mikhail

    07/24/2022, 2:12 PM
    What the hell? Remote Development in Intellij is literally unusable. It isn't even able to build the project... Ok... I could simply use
    sshfs
    but Intellij becomes INCREDIBLY slow with it
    • 1
    • 6
  • e

    edwinRNDR

    07/26/2022, 9:03 AM
    Is there a reason for the Kotlin plugin not providing help when hovering over language keywords (such as
    fun
    ,
    while
    ,
    import
    ,
    sealed
    ,
    internal
    )? I think such a feature would greatly help newcomers to the language.
    s
    a
    • 3
    • 2
  • a

    aarjav

    07/28/2022, 3:53 PM
    I just updated to new version 2022.2 and it switched to new UI. Is there anyway I can revert it? I tried to find an option in settings but didn't see anything. (I had tried out the new ui in a separate EAP version)
    c
    • 2
    • 6
  • k

    Kuba Petržílka

    07/30/2022, 11:57 AM
    Hi, why am I getting this error when I try to use the new type parameter inference feature? I, m using latest IntelliJ and plugin version and Kotlin 1.7.10 dependencies.
  • a

    Alexander Maryanovsky

    07/31/2022, 9:51 AM
    “Invalidate Caches” doesn’t help either.
    j
    i
    • 3
    • 5
Powered by Linen
Title
a

Alexander Maryanovsky

07/31/2022, 9:51 AM
“Invalidate Caches” doesn’t help either.
j

Javier

07/31/2022, 11:56 AM
temporal fix is removing and adding a letter in the optin, but it will start to be red again soon.
i

Igor Kolomiets

08/01/2022, 3:57 PM
same with
@file:OptIn(ExperimentalSerializationApi::class)
very annoying 😞
a

Alexander Maryanovsky

08/01/2022, 5:50 PM
It’s the same for any experimental API
Here’s the ticket: https://youtrack.jetbrains.com/issue/KTIJ-22253
Post and upvote there.
View count: 1