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?
Please sign in to leave a comment.
Most probably, folded-corner-document icon files do not have a kotlin class inside.
@Petr Rastegaev
Sometimes they do (and the class name matches the file name), and sometimes they don't.
Interesting, could you please provide a file example where they don't.
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.
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 :)
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.
@Yaroslav: nice!