Hello guys Kotlin noob here. I have declared some ...
# getting-started
t
Hello guys Kotlin noob here. I have declared some top level functions inside
Utils.kt
file which I'm calling them in another class but how can someone else find out that those functions reside in the
Utils.kt
file just by reading at my code? If you ctrl+click on function IntelliJ takes me to the
Utils.kt
file but how can I do that without the help of the ide?
h
If you're using them from another package, you'll have to
import
them - that's how to know where they come from.
t
yeah I just need to import the name of the function e.g
com.mypackage.roundNumber
but I don't actually know that
roundNumber()
function resides in
Utils.kl
file
s
I think you will have to look at all files in the package
Use grep 🙂
h
Use an IDE. Nobody is coding without one anyway.
t
haha @hho true but I was considering the scenario where I just do a quick reading from a github repo and stumble upon a function like that and need to know what it does so I need to find a the appropriate file without the help of ide
@spand
grep
could be a good solution if you have the files stored in your pc but I was thinking of the scenario I described above ☝️
h
I think Github's code search might be working as a
grep
replacement in that case.
t
oh yeap you are right @hho didn't think of that 😛 thanks