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

    kirillrakhman

    02/07/2017, 8:22 AM
    you can Ctrl + Alt + Shift + N and type "main"
    v
    • 2
    • 1
  • m

    miha-x64

    02/11/2017, 9:34 PM
    I was getting errors about Java 5 language level. Set 7 everywhere in Project Structure and Settings. Getting problem with 'diamond' (
    new TreeSet<>()
    )
    Wrong 1st argument type. Found: java.util.TreeSet<java.lang.Object>, required: java.util.Set<java.lang.Long>
    And where are these memory tools? Can't find any mentions in the blog. Actually, new IDEA looks faster, has better icons, and I really like parameter name badges. ❤️
    j
    s
    • 3
    • 6
  • o

    orangy

    02/11/2017, 9:36 PM
    In the debug window
    m
    j
    • 3
    • 5
  • m

    michael.barker

    02/18/2017, 8:39 PM
    what's am I doing wrong when IntelliJ doesn't show decompiled Kotlin and instead shows the method body as
    /** compiled code **/
    m
    y
    v
    • 4
    • 8
  • y

    yole

    02/23/2017, 10:24 AM
    we're following the precedent set by many other languages, e.g. https://google.github.io/styleguide/javaguide.html#s4.6.2-horizontal-whitespace
    b
    • 2
    • 2
  • y

    yole

    03/08/2017, 11:19 AM
    Settings | Build, Execution, Deployment | Build Tools | Gradle | Runner | [x] Delegate IDE build/run actions to Gradle
    a
    • 2
    • 1
  • e

    elect

    03/09/2017, 2:39 PM
    just made the effort to look how to move caret in camel humps mode
    k
    • 2
    • 2
  • s

    snowe

    03/10/2017, 11:48 PM
    @cleiter do you have any insight into what caused that issue? I'm getting the same error.
    c
    • 2
    • 1
  • j

    javaru

    03/14/2017, 3:55 PM
    If we have a maven project that has the
    kotlin-maven-plugin
    configured with
    <jvmTarget>1.8</jvmTarget>
    , should the idea IDEA project's Kotlin Compiler > Target JVM Version be auto-synced (upon re-importing the maven project) to the POM so it is also set to 1.8? Currently its not doing such and remains set to 1.6.
    a
    • 2
    • 7
  • k

    kirillrakhman

    03/20/2017, 1:36 PM
    @deviant a bit offtopic, but assuming you're using retrofit, I would argue against naming your methods
    getSubscriber
    d
    • 2
    • 3
  • y

    yole

    03/20/2017, 9:45 PM
    for content roots, there's currently a checkbox that you need to check in the "new project" dialog ("create directories for content roots" or something like that). the next IJ version will always create the directories
    v
    • 2
    • 2
  • c

    Czar

    03/21/2017, 7:30 PM
    @semoro I have
    -Xmx2048m
    s
    • 2
    • 7
  • y

    yoavst

    03/27/2017, 5:02 PM
    I have a data class with 15 properties (I need to write a program to convert a form to usable spreadsheet). IDEA suggests me to replace
    list.filter { item -> /* do something with item.pair */ }
    to
    items.filter { (a, b, c, d, e, f, g, h, i, j, k, l, m, n, pair) -> /* do something with pair */ }
    As you can see, pair is the last argument, so this suggestion is bad.
    m
    • 2
    • 1
  • s

    snowe

    03/30/2017, 7:20 PM
    is it a known problem where completions take tens of seconds for kotlin files? it doesn't happen for java files at all. completion is near instant.
    s
    • 2
    • 1
  • d

    dalexander

    04/03/2017, 12:21 PM
    I’m running into a minor annoyance where IDEA keeps adding .idea/kotlinc.xml to a non-kotlin project. Unfortunately for reasons
    .idea
    is not in the
    .gitignore
    , so I keep having to delete it. Does anyone know if there’s a way to prevent IDEA from re-generating that file in a non-Kotlin project?
    p
    • 2
    • 3
  • s

    sreich

    04/08/2017, 3:08 PM
    ctrl -e..never shows up there
    h
    • 2
    • 1
  • k

    kirillrakhman

    04/10/2017, 9:18 PM
    hector
    so that's what this guy is called 😄
    😂 3
    k
    • 2
    • 2
  • s

    sdeleuze

    04/21/2017, 4:45 AM
    @janvladimirmostert Did you check https://thoeni.io/post/macos-sierra-java/ ?
    :kotlin-flag: 2
    💪 2
    ➕ 3
    j
    • 2
    • 3
  • y

    yole

    04/27/2017, 8:16 AM
    @trevjones "refactor function to extension function" already exists. press alt-enter on a parameter and select "convert parameter to receiver"
    👍 1
    c
    t
    • 3
    • 3
  • t

    trevjones

    04/27/2017, 10:46 PM
    I am attempting to insert an image in the doc block of a kotlin class via html image tag but the F1 popup is not loading the image. Is this a known issue?
    s
    • 2
    • 4
  • d

    Dalinar

    05/07/2017, 9:06 AM
    does anyone know how to prevent intellij from importing into a kotlin file (whenever it organizes the imports) java
    Map
    ,
    List,
    ,
    String
    java classes that kotlin has its own classes for. removing the import doesn't help. It just puts itself back - and of course colours the file also sorts of red since it can't compile anymore.
    k
    y
    • 3
    • 4
  • n

    nomad

    05/12/2017, 8:06 AM
    We are having an issue with compiling kotlin from Intellij after the upgrade to 1.1.2 - basically what happens is that if we make a change in module 1, then module 2 that depends on it does not detect this change. However, the editor does mark the code as red and uncompilable, but "Build Project" will give happily still compile, not seeing the change in module 1. This obviously leads to runtime errors like NoSuchMethod and so on. We tried to reproduce it with a minimal project but were unable, so we are pretty much at a loss as what to do. We have been doing kotlin for more than 9 months, and we are certain it only happened after the upgrade to kotlin 1.1.2. Compiling from gradle also works just fine. Are there any debug switches or anything we can enable so we can get gather more data? As I take it it is very hard to find the bug from the info I can provide so far. I'm thinking maybe some debug output of the classes that are being recompiled upon "Build Project"?
    z
    • 2
    • 4
  • d

    dersoz

    05/17/2017, 8:19 AM
    Is there a way to see Kotlin
    TODO()
    functions in IntelliJ TODO window? I tried adding a pattern like
    \bTODO\s*\(
    however it does not seem to work.
    m
    • 2
    • 2
  • l

    liminal

    05/25/2017, 12:27 AM
    Hi all, not sure if this is the correct place to report this. I am using Kotlin plugin 1.1.2 with Android Studio 2.3-3. I wrote:
    if (x !is String) return
    and the IDE suggested that I should replace
    if
    operator with elvis. I tried replacing it with
    (x is String) ?: return
    but got a warning "Elvis operator always returns the left operand of non-nullable type Boolean". The same statement produces the same error in try.kotlinlang.org.
    y
    • 2
    • 2
  • c

    cedric

    05/26/2017, 3:00 PM
    @mingkangpan Be aware your code is not safe. I would rewrite this loop to avoid the
    !!
    m
    b
    • 3
    • 5
  • g

    gaetan

    05/31/2017, 9:24 PM
    I have sometimes performances issues in intellij. I added a .vmoptions files as indicated here: https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems?page=2#comments
    o
    • 2
    • 1
  • s

    Slackbot

    06/05/2017, 1:18 PM
    This message was deleted.
    o
    p
    • 3
    • 2
  • k

    kirillrakhman

    06/07/2017, 10:35 AM
    this is most likely caused by https://github.com/Triple-T/gradle-play-publisher and has nothing to do with #intellij
    d
    • 2
    • 2
  • y

    yole

    06/08/2017, 11:28 AM
    what does this have to do with kotlin?
    p
    • 2
    • 1
  • b

    barteks2x

    06/11/2017, 1:25 PM
    it also seems to contradict itself:

    http://i.imgur.com/VjgZxFw.png▾

    z
    • 2
    • 9
Powered by Linen
Title
b

barteks2x

06/11/2017, 1:25 PM
it also seems to contradict itself:

http://i.imgur.com/VjgZxFw.png▾

z

zeljko

06/20/2017, 6:24 AM
barteks2x: Are you using Gradle? Try to compile from command line and then try IDE again.
b

barteks2x

06/20/2017, 12:45 PM
@zeljko I'm using kotlin in gradle buildscript. Recompiling from commandline doesn't change anything.
z

zeljko

06/20/2017, 1:04 PM
@barteks2x I thought that you have similar problems to this one, but if building with Gradle does not help, maybe it is a different problem: https://youtrack.jetbrains.com/issue/KT-18475
b

barteks2x

06/20/2017, 1:06 PM
It does build from commandline
But intellij thinks it's wrong
z

zeljko

06/20/2017, 1:07 PM
Delete "build" folders and try again.
b

barteks2x

06/20/2017, 1:30 PM
It's still doing that, still the same parts are in red
And I remember this part working with some previous version (some early 1.1?)
z

zeljko

06/21/2017, 4:37 PM
Many people start to complain after upgrade to 1.1.2. Try to play with deleting and rebuilding from command line and upvote or report bug in issue tracker.
View count: 2