Sasha Shpota
Sasha Shpota

Reputation: 10310

How to navigate to a Kotlin type declaration from a variable with an inferred type in IntelliJ IDEA?

Let's say I have a code like this:

val request = buildRequest()

Problem: I want to see what the type of request is and navigate to its declaration.

I can find out the type by hovering the variable or using Ctrl+Shift+P, but I haven't found an easy way to navigate to the type itself. command + click doesn't work here.

Question: How to navigate to the type declaration of a variable whose type is inferred?

Upvotes: 8

Views: 343

Answers (3)

Alexey Nurmukhametov
Alexey Nurmukhametov

Reputation: 23

For Mac users

F1 or + J - find out the type

+ Shift + B - go to type declaration

Upvotes: 0

Ildar Serazitdinov
Ildar Serazitdinov

Reputation: 116

Have you tried using Ctrl + Shift + B keyboard shortcut?

This tip for Windows or Linux users.

Context menu

Result of Type declaration choose

Upvotes: 10

Filip Wicher
Filip Wicher

Reputation: 21

If you are using Mac, try + B

Upvotes: -1

Related Questions