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

    andylamax

    08/05/2022, 5:25 AM
    IDEA is failing me once again.. Projects builds just fine on terminal, but IDEA can't resolve imports to my dependencies. Kotlin: 1.7.10 | 1.7.20-Beta Gradle: 7.5 Tried enabling and disabling hierarchicalStructureSupport in gradle.propertied I even downloaded three different versions of IDEA How do I solve this? anyone?
    c
    o
    • 3
    • 2
  • n

    Norbi

    08/07/2022, 2:03 PM
    Maybe:
    t
    i
    • 3
    • 2
  • k

    Klitos Kyriacou

    08/10/2022, 10:44 AM
    When I write
    DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
    an IntelliJ inspection tells me I have a typo in "dd'T'" and in "SSSZ". Is there a way to turn this off? Ideally, IntelliJ ought to be intelligent enough to detect that this string is not written in English, but instead should check that it's a valid pattern for DateTimeFormatter.
    r
    • 2
    • 2
  • k

    Kuba Petržílka

    08/10/2022, 4:18 PM
    @FunctionalInterface
    public interface ApplicationListener<E extends ApplicationEvent> extends EventListener {
    
    	void onApplicationEvent(E event);
    
    	static <T> ApplicationListener<PayloadApplicationEvent<T>> forPayload(Consumer<T> consumer) {
    		return event -> consumer.accept(event.getPayload());
    	}
    
    }
    • 1
    • 1
  • c

    Claude Brisson

    08/12/2022, 9:35 AM
    With 2022.2.1 RC I still get the dreaded "cannot access java.lang.Comparable etc." in my build.gradle.kts files, as if the IDE didn't index the jvm... In some previous versions reloading the project or changing the jvm in the Project Structure dialog did solve the problem, but now I cannot get rid of it... I also tried upgrading gradle to the last version, but it didn't solve the problem. I'm using the 1.7.10 kotlin toolchain.
  • r

    rrva

    08/15/2022, 10:07 AM
    How do I move a bug that was filed wrongly at https://youtrack.jetbrains.com/issue/IDEA-299961
  • s

    steamstreet

    08/15/2022, 5:17 PM
    I checked and it’s happening with Java files too, so I guess this isn’t Kotlin specific
    c
    • 2
    • 2
  • e

    Ellen Spertus

    08/17/2022, 7:34 PM
    It makes me sad that there is no way to globally set Actions on Save to Reformat Code for all new projects. I'm a professor and will have to tell my students to do that every time they create a project. I hope someone can let me know a workaround or upvote the issue. https://intellij-support.jetbrains.com/hc/en-us/community/posts/7178879949842-Is-there-a-way-to-set-Actions-on-Save-for-all-new-projects-
    s
    a
    • 3
    • 19
  • s

    sreich

    08/18/2022, 6:23 PM
    is there a way to add notes or bookmarks on lines of code. I find that i want to take notes of what my current thinking is, for when i step away from debugging. i see i can set a bookmark on a line, and name it with a desciprtion. but there's no way to view that description unless i rename the bookmark again?
    c
    g
    • 3
    • 12
  • g

    Gillian Buijs

    08/19/2022, 8:03 AM
    I'm creating an IJ plugin and the build fails half the time because of below exception. I think it's memory related, but I already bumped min/max to 4/8GB for gradle... Anyone now what else I could do? Just rerunning build works but its time consuming and also very annoying in CI...
    Execution failed for task ':lib:klutter-jetbrains:buildSearchableOptions'.
    > Process 'command '/Users/thisidiot/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbr_jcef-11_0_14_1-osx-x64-b2043.45/extracted/jbr/Contents/Home/bin/java'' finished with non-zero exit value 3
    stacktrace: SEVERE - #c.i.i.p.PluginManager - Current thread: Thread[AWT-EventQueue-1,6,main]; expected: Thread[AWT-EventQueue-0,6,] java.lang.IllegalStateException: Current thread: Thread[AWT-EventQueue-1,6,main]; expected: Thread[AWT-EventQueue-0,6,] at com.intellij.openapi.application.impl.ReadMostlyRWLock.checkWriteThreadAccess(ReadMostlyRWLock.java:287) at com.intellij.openapi.application.impl.ReadMostlyRWLock.writeIntentLock(ReadMostlyRWLock.java:196) at com.intellij.openapi.application.impl.ApplicationImpl.acquireWriteIntentLock(ApplicationImpl.java:944) at com.intellij.openapi.application.impl.ApplicationImpl.lambda$new$2(ApplicationImpl.java:181) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:393) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
  • a

    Alexey Belkov [JB]

    08/19/2022, 10:44 AM
    2. Check that you have enabled “Inspections | General | Incorrect formatting”
    k
    • 2
    • 2
  • r

    Roland Ringgenberg

    08/19/2022, 7:40 PM
    What is the state to have the KMM plugin available for IntelliJ? I’m working on a multiplatform project targeting several targets (not only android and ios) and finally started to take a closer look to ios. Unfortunately it seems to me that many (most?) of the iosApp features are not available in IntelliJ (payed version, since many years!), but only in Android Studio and AppCode. When can we expect that this tooling will come to Intellij?
    b
    • 2
    • 2
  • m

    Mahmoud Ahmed

    08/20/2022, 4:41 AM
    I want to know how to put the warning of 'magic number' in the ItellJ IDE and what should put in the @suppress() annotation to suppress it
    s
    • 2
    • 1
  • p

    Pedro Henrique

    08/20/2022, 10:06 PM
    I' ve published a library to Maven that uses Kotlin MPP 1.7.20-Beta + API/Language version of 1.8. With the same settings, using this library through Gradle, it runs fine, but on IntellIJ I get a message saying that 'it is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler'. It only happens on JVM and IDEA-side, since I can build it normally and common and JS platforms aren't giving me this error.
  • p

    Pedro Henrique

    08/20/2022, 10:07 PM
    Is there any workaround to this issue?
  • p

    Pedro Henrique

    08/21/2022, 12:05 AM
    Maybe this is related: https://youtrack.jetbrains.com/issue/KTIJ-22444/False-positive-pre-release-version-error-with-context-receivers-enabled-and-depending-through-Maven
  • x

    Xiang Rong LIn

    08/25/2022, 12:03 PM
    Can I temporarily add a dummy PsiElement to the document during an refactoring action, if so how? Background: I'm currently working on expanding the refactoring action to introduce constants to companion objects. The extraction engine works, by providing it a sibling element of the target location. In the case of an empty companion object there is not sibling. So I want to add a temporary sibling and remove it after the extraction action is done
    a
    • 2
    • 1
  • k

    Klitos Kyriacou

    08/25/2022, 3:56 PM
    IntelliJ IDEA has inspections for "synchronization on non-final field" for both Java and Groovy, but not for Kotlin. Is it actually missing, or have I not noticed it?
    a
    • 2
    • 2
  • k

    Klitos Kyriacou

    08/26/2022, 2:49 PM
    It only insists on a blank line if the previous case had multiple lines. It's not just the
    else
    case. Put a case
    4 ->
    before the
    else
    and you'll see the suggestion for a blank line before
    4 ->
    . See the guideline in https://kotlinlang.org/docs/coding-conventions.html#control-flow-statements: "In a
    when
    statement, if a branch is more than a single line, consider separating it from adjacent case blocks with a blank line"
    p
    j
    • 3
    • 2
  • a

    andylamax

    08/27/2022, 10:20 PM
    Is there a command that I can enter in the current open terminal in intelliJ, that would open a text file into ItelliJ's text editor?
    b
    m
    • 3
    • 9
  • t

    thana

    08/30/2022, 3:29 PM
    how can i diable the convert-java-to-kotlin-on-paste feature? i find it rarely usefull and almost every time intellij simply crashes
    a
    • 2
    • 5
  • g

    Gavin Ray

    08/31/2022, 7:08 PM
    Is there no
    Rearrange code
    integration for Kotlin by default in IDEA Ultimate? (The setting doesn't seem to work for me) Does anyone know if the Detekt/Ktlint plugins can do this, if not?
    a
    • 2
    • 1
  • m

    mbonnin

    09/01/2022, 8:32 AM
    Is "reformat code" supposed to be idempotent? I just had a case where applying it twice made changes the second time. That was unexpected but maybe it's normal?
    e
    e
    +2
    • 5
    • 6
  • e

    Ellen Spertus

    09/03/2022, 12:33 AM
    Is there any easy way to run #dokka from within IntelliJ if you created the project using the IntelliJ build system (as opposed to Gradle or Maven)? I've searched online and have only found people saying you can't do it. I want to make things easy for my CS1 students.
    a
    • 2
    • 3
  • j

    James Richardson

    09/07/2022, 10:53 AM
    I was wondering if it was possible to start a constructive discussion on refactoring support for kotlin in intellij. Around the place a lot of people have been expressing concerns to me about the perceived poor support for refactoring. Refactoring was a massive feature in favour of intellij when editing java, but basic features seem to be fat less powerful or correct when editing kotlin. This is so important when working on larger production codebases. Using java, refactorings were SO reliable... I'm not sure this is the case anymore. Things like - extract method or variable not working reliably, moving things around messes up imports... I sort of feel that it's not up to people who pay good money to raise youtrack tickets, which may never be actioned, to get this kind of expected functionality. I'm also surprised that jetbrains developers don't see these same problems in their own kotlin codebases. I dont work on Android, nor use Spring - I'm just talking about kotlin, and kotlin+java. Am I alone, in which case - thanks for reading... or maybe we can discuss some issues and JB can talk about their thoughts on the matter too. Please read this in the spirit in which it is intended, about constructively raising what I see to be a bit of an issue in IDEA, a product I've been using since 2003 or 2004, I think!
    a
    c
    +6
    • 9
    • 41
  • s

    Sam

    09/08/2022, 9:06 AM
    I noticed it when using
    @Throws
    , which is an
    actual typealias
    and ends up with the same weird highlighting as a result
    a
    • 2
    • 1
  • a

    Adam Brown

    09/12/2022, 1:44 AM
    I've got a weird issue where IntelliJ cant build any of my Android projects. I've completely uninstalled and reinstalled the IDE, as well as the SDK, and I went into my local files and deleted all of the IntelliJ configs. I also deleted and redownloaded my source code, and of course invalidate and restart, nothing helps. This is the error I get when it tries to sync gradle:
    Module: 'android' platform 'android-32' not found.
    And that platform is definitely installed.
    m
    • 2
    • 4
  • l

    Lukellmann

    09/13/2022, 12:37 AM
    I saw this somewhere: the inspection/warning/error name is displayed within IntelliJ (
    [DEPRECATION_ERROR]
    in this case). How can I enable this? https://media.discordapp.net/attachments/705391960785158164/999092837771640962/unknown.png?width=1440&amp;height=153 I only get something like this:

    https://media.discordapp.net/attachments/705391960785158164/999093301338718208/unknown.png▾

    The reason I would like to see these names is that
    @Suppress
    seems to work for some errors too, but I would need to know the name for them to suppress them.
    a
    s
    • 3
    • 4
  • g

    Grouvie

    09/13/2022, 3:23 PM
    Where can I find information about building multiproject web applications?
    n
    • 2
    • 5
  • d

    Dmitriy Malayev

    09/15/2022, 7:50 AM
    👋 Hello, team!
Powered by Linen
Title
d

Dmitriy Malayev

09/15/2022, 7:50 AM
👋 Hello, team!
View count: 2