Some of my project files have a .kt extension in the Project tool window, some do not

Answered

The files that end in .kt show up with a folded-corner-document icon, the ones that don't have a circle-C (I assume meaning "class").

Why is that?

0
7 comments

Most probably, folded-corner-document icon files do not have a kotlin class inside.

0
Avatar
Permanently deleted user

@Petr Rastegaev

Sometimes they do (and the class name matches the file name), and sometimes they don't.

0

Interesting, could you please provide a file example where they don't.

0
Avatar
Permanently deleted user

Unfortunately, I can't share the proprietary code that reproduces the issue, and I currently don't have any bandwidth to investigate and provide a sample project.

0
Avatar
Permanently deleted user

Had the same issue, the class doesn't have a Class icon was because I had some private methods defined outside of the Class. Hope it helps :)

0

If a file defines only a single class (and class name is the same as file name), then the Project view node shows that class. If there are multiple declarations in the file (or class name differs), then the Project view node shows a file icon and extension.

1
Avatar
Permanently deleted user

@Yaroslav: nice!

0

Please sign in to leave a comment.