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

    poohbar

    08/02/2019, 3:18 PM
    Our Maven + Java + Kotlin project has gotten even slower in 2019.2. It takes about 5 seconds for the error highlighter to refresh even in small files. Isn't IntelliJ itself a mix of Java and Kotlin? I guess it could be the Maven part that JetBrains is just refusing to optimize for.
    c
    r
    +3
    9 replies · 6 participants
  • d

    Drew Hamilton

    08/05/2019, 7:11 AM
    Is there a way to debug whether an inline class instance is boxed or unboxed at any given point?
    u
    k
    4 replies · 3 participants
  • c

    carlw

    08/07/2019, 5:57 PM
    Anyone have trouble with Ultimate's Update and Restart? I tried to update today and my IntelliJ broke so I reverted to 2019.1 . Had this problem a few weeks ago too and figured I'd try again
    m
    1 reply · 2 participants
  • p

    poohbar

    08/08/2019, 2:27 PM
    Here is a screen recording of IntelliJ's performance in Kotlin files in Maven/Java/Kotlin project. The file has about 400 lines. The project has ~1000 files, 80% is Java. Hardware is a 2015 Mac Pro (2.2 GHz i7, 16 GB RAM). Notice that it takes more than 5 seconds for the IDE to realize the compile error has been fixed and then several additional seconds for the IDE to reformat the code.
    IntelliJ IDEA 2019.2 (Ultimate Edition)
    Build #IU-192.5728.98, built on July 23, 2019
    Please note, that this is not a new thing. It always took more than 2 seconds for the inspections to kick in which was already unacceptable. As you can see now it's even worse and is completely unusable. But even if we go back to 2 seconds, it's still really bad. https://i.imgur.com/PcwdG7Q.mp4
    s
    l
    +1
    13 replies · 4 participants
  • j

    jrgonzalez

    08/09/2019, 9:29 AM
    Hi, is there a way to remove special handling of
    java.*
    imports for Kotlin files on Android Studio (IntelliJ) when sorting / optimizing imports? For Java files there is a “Preferences - Code Style - Java - Imports - Import Layout” where I can remove the special handling of
    java.*
    but for Kotlin I haven’t found a way to do it so I am continuously having issues with not properly sorted java imports when checking official Kotlin code style with ktlint.
    ➕ 5
    j
    a
    5 replies · 3 participants
  • d

    David Glasser

    08/19/2019, 8:42 PM
    Does anyone know if it's possible to get IntelliJ to show all the (implicit) uses of
    this
    in a scope?
    r
    l
    4 replies · 3 participants
  • a

    arekolek

    08/20/2019, 9:19 AM
    Files that contain only a single class are marked with the lower icon (“Kotlin class”) while other files with the top one (“Kotlin file”). Wouldn’t it make more sense if private top-level declarations would not cause the icon to be “Kotlin file”? So for example, this file would still be counted as a “Kotlin class”:
    class Foo {
        fun bar(): String = BAZ
    }
    
    private const val BAZ = "baz"
    ➕ 8
    k
    d
    7 replies · 3 participants
  • s

    Stefan Beyer

    08/21/2019, 11:37 AM
    Hello 🙂 Do you guys know of a way to automatically turn a constructor argument into an abstract property? For example, how to change this:
    abstract class BaseGreeter(val salutation: String) {
        fun greet(name: String) = println("$salutation, $name!")
    }
    
    class HelloGreeter: BaseGreeter("Hello") {
        // class specific stuff here
    }
    class HiGreeter: BaseGreeter("Hi") {
        // class specific stuff here
    }
    class AhoiGreeter: BaseGreeter("Ahoi") {
        // class specific stuff here
    }
    
    fun main() {
        AhoiGreeter().greet("Kotlin")
    }
    into this:
    abstract class BaseGreeter {
        abstract val salutation: String
        fun greet(name: String) = println("$salutation, $name!")
    }
    
    class HelloGreeter: BaseGreeter() {
        override val salutation = "Hello"
        // class specific stuff here
    }
    class HiGreeter: BaseGreeter() {
        override val salutation = "Hi"
        // class specific stuff here
    }
    class AhoiGreeter: BaseGreeter() {
        override val salutation = "Ahoi"
        // class specific stuff here
    }
    
    fun main() {
        AhoiGreeter().greet("Kotlin")
    }
    I have some refactoring to do and this is a task that would probably take me half a day if I have to do this all manually ^^
    m
    4 replies · 2 participants
  • s

    simon.vergauwen

    08/21/2019, 1:03 PM
    Not sure if it’s an Android Studio (3.5) or Kotlin plugin issue but the
    inline function
    refactor action is not working for me in a multi module project. Has any1 encountered this? EDIT: also broken in IntelliJ IDEA 2019.1.3 (Ultimate Edition) Build #IU-191.7479.19, built on May 28, 2019 JRE: 1.8.0_202-release-1483-b58 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.14.6 Kotlin plugin used: 1.3.41-release-IJ2019.1-1
    u
    3 replies · 2 participants
  • s

    simon.vergauwen

    08/23/2019, 2:36 PM
    I know this channel is meant for Kotlin plugin but IntelliJ broke completely when updating from
    2019.1
    to
    2019.2
    and I need a fresh install it seems 😞 Hope I am alone and it’s something on my machine but take care.
    n
    3 replies · 2 participants
  • n

    napperley

    08/24/2019, 4:33 AM
    Code completion is broken in IntelliJ after updating the IDE to v2019.2.1 (using the Linux version), and the Kotlin plugin to v1.3.50 with a new Kotlin Native project. No code completion dialog appears when editing a kts file, and attempting code completion in a kt file will cause the keyboard input to become garbled (eg some keys like A are not recognised in the code editor, and some are outputted as a completely different character) ☹️ 😡.
    c
    6 replies · 2 participants
  • c

    christophsturm

    08/27/2019, 3:08 PM
    if i convert a java file to kotlin, is there an easy way to git diff the kotlin file with the original java file? can i tell idea to diff a file with a different file?
    k
    m
    3 replies · 3 participants
  • m

    mathew murphy

    08/27/2019, 9:05 PM
    I'm building some SQL using constants in Kotlin strings, e.g.
    "DELETE FROM ${SCHEMA}.TABLENAME WHERE PK = ?"
    , and then preparing statements and injecting values. IntelliJ can't resolve the table ("Unable to resolve table TABLENAME"), and I can't work out how to either (a) tell it not to try for this specific string, or (b) tell it where the table is.
    m
    6 replies · 2 participants
  • g

    ghedeon

    08/28/2019, 6:28 AM
    Any way to setup AS formatter as a pre-commit hook? I, personally, think that build-in commit dialog is the best, but some folks prefer SourceTree and I'm wondering if they can have formatation automated as well.
    a
    1 reply · 2 participants
  • a

    arekolek

    08/28/2019, 10:27 AM
    If I have this code
    fun test(a: Pair<Int, String>, b: Pair<Int, String>): Boolean {
        return a.first == b.first
                && a.second == b.second
    }
    and use extract variable refactoring to get:
    fun test(a: Pair<Int, String>, b: Pair<Int, String>): Boolean {
        val result = (a.first == b.first
                && a.second == b.second)
        return result
    }
    you can see IDE added parentheses there. Aren’t those unnecessary? IDE doesn’t offer an intention to get rid of them. But if I do, it compiles and runs the same.
    s
    2 replies · 2 participants
  • r

    ribesg

    09/02/2019, 1:47 PM
    Am I the only one to think that IntelliJ has been getting more and more unstable/unreliable? Just now I’m asking it to open a project and it just doesn’t do anything. I feel like I encounter a new bug every day, and it starts to feel like the Eclipse days
    ➕ 5
    👎 3
    e
    r
    +2
    8 replies · 5 participants
  • s

    serebit

    09/04/2019, 8:03 PM
    IntelliJ doesn't seem to like the new granular source set metadata setting... It invalidates my JVM-specific code if I have it enabled in a multiplatform project, for some reason. The project still builds and runs fine.
    d
    2 replies · 2 participants
  • h

    hooliooo

    09/11/2019, 11:42 AM
    I accidentally created a file named SomeClass.txt, deleted and created it as SomeClass.kt, however the IDE offers no syntax highlighting or code completion. I’ve invalidated my cache and restarted but still the same result, how do I fix this?
    c
    s
    5 replies · 3 participants
  • p

    poohbar

    09/13/2019, 12:55 PM
    Can I stop IntelliJ from automatically inserting
    .trimIndent()
    on multiline strings? I will trim indent when I decide to trim indent!
    ➕ 1
    a
    1 reply · 2 participants
  • p

    poohbar

    09/13/2019, 1:44 PM
    I have a breakpoint on a Kotlin class definition:
    class MyClass(private val xyz: String)
    It seems like the debuggers stops in the constructor which is what I would expect. I would like to add a condition to the breakpoint to only stop when
    xyz
    equals
    "myString"
    but it won't let me access
    xyz
    in the input field. Is this is a bug?
    c
    a
    4 replies · 3 participants
  • d

    Dico

    09/21/2019, 10:00 PM
    I recently converted my project from multiplatform (with most code in common) to jvm-only. IntelliJ is now way slower in all source code files. Code completion, highlighting, etc, typically takes 15 seconds now. Any clues why this could be happening?
    a
    1 reply · 2 participants
  • k

    karelpeeters

    09/25/2019, 11:25 AM
    I'm trying to add a third sourceset/module, similar to
    main
    and
    test
    but called
    local
    . I want it to depend on both
    main
    and
    test
    . This is my build.gradle: https://pastebin.com/raw/5u89DqYP, building with gradle commandline seems to work so i think that's correct. I'm having some problems getting it to work in intelij though, when I change any code in eg. the
    main
    module I start to get build errors like this:
    m
    9 replies · 2 participants
  • s

    Sylvain Patenaude

    09/25/2019, 8:38 PM
    message has been deleted
    g
    2 replies · 2 participants
  • k

    karelpeeters

    09/26/2019, 3:35 PM
    A quick check before I report, you used to be able to run individual JUnit tests, right? When I press the run button it just runs the entire class instead:
    m
    a
    4 replies · 3 participants
  • m

    Marc Knaup

    09/29/2019, 8:38 AM
    Is there a chat for discussing IntelliJ IDEA development? My self-compiled one is crashing right at startup 😅 (an NPE in some touchbar code when loading touchbar buttons for EULA screen but
    getApplication()
    still returns
    null
    )
    a
    3 replies · 2 participants
  • r

    ribesg

    09/29/2019, 10:24 AM
    How do you disable auto imports in build.gradle.kts files? IntelliJ is driving me nuts getting lost and messing with my files, breaking everything again and again. EDIT: I’m not talking about reimporting the gradle project, I’m talking about IntelliJ literaly adding
    import ...
    for nonsense which breaks everything and I can’t remove them
    l
    2 replies · 2 participants
  • m

    Marc Knaup

    09/30/2019, 4:31 AM
    Is there way to visualize a Kotlin project as UML or something like that?
    k
    a
    5 replies · 3 participants
  • d

    Donal

    09/30/2019, 8:53 AM
    If a Kotlin file contains multiple classes, in the Project view it is shown as
    MyFile.kt
    , but there is no way to see the classes it contains. By contrast, if a Groovy file contains multiple classes, you can expand the file in the Project view to see the classes therein, so it’s surprising that this functionality doesn’t also exist for Kotlin. Is it possible to see the (multiple) classes contained in a Kotlin file in the Project view?
    k
    2 replies · 2 participants
  • m

    mathew murphy

    10/02/2019, 2:07 PM
    Ooh! BBC owl!
    d
    1 reply · 2 participants
  • m

    mathew murphy

    10/02/2019, 2:07 PM
    Uh, for reference, is there a way to make IntelliJ editor windows have striped lines, so I can put two tabs next to each other and cross-reference more easily?
    k
    1 reply · 2 participants
Powered by Linen
Title
m

mathew murphy

10/02/2019, 2:07 PM
Uh, for reference, is there a way to make IntelliJ editor windows have striped lines, so I can put two tabs next to each other and cross-reference more easily?
k

karelpeeters

10/02/2019, 10:07 PM
Not a real answer but for cross-referencing you can use the diff view.
View count: 3