I am trying to create a kotlin project with intellij idea But can't create kotlin file under src file - kotlin

I want to open a kotlin file on a blank screen and work. However, as seen in the 2nd image, the kotlin-file/class tab does not appear.

Inside the src folder you have a main folder, which is followed by a kotlin folder which will likely appear blue. This means it's a source root. IntelliJ will only allow you to create code files in a source root.

Related

View file in project view Intellij

I have started using Intellij and I am trying to find a feature that was in eclipse. I often navigate to a file either through the code or through a CTRL-N search. When I have the file I found open, I want to see which project and which folder of the project the file is in. I found a way to open the file in Windows Explorer which tells me what I want but I would rather stay in intellij and see the folders on the left expanded to the location of the file. Does this exist in intellij?
Thanks
On the heading of Project Explorer panel their will be a circle with 4 lines inside it.
Press that it will take you to the place where you file is inside the project
Image upload not working thats why explaination

Include Files for autocompletion outside src-directory in Intelij

Intellij always index every file in my project to give me the best autocompletion-suggestions. But there is one probelm it only indexs the files from src - directory for autocompletion.
now i got some css styles from a node-module which i also want to get autocompletion-suggestions.
i could fix this with 2 bad solutions:
by copying those css files directly inside the src
dir. The problem is now that when the styles inside node modules gets
updated the copyied files, didn't got there update.
by marking the complete node_modules dir as src folder,
but then i get autocompletion and Ctrl+Shift+N - suggestion also from
this dir that should happen only for one specific node-module.
Can i tell intellij that it should also use those specifics files for autocompletion? And not only those from the src-folder?
I'm using Intellij IDEA 2016.1.3

Play Framework with IntelliJ, no option to create 'Java File'

I got the IntelliJ IDEA Ultimate edition, and tried creating Play Framework Project. But something is wrong.
Create New - Project - Java - Play 2.x. Project gets created. When I want to create a new Java File, I right clicked on Package - New - (no option to create Java file) - File, Directory, Html File, Stylesheet, Javascript etc. No option to Create Java File is shown.
I know that a folder has to be marked as Sources by doing right click - Mark Directory as - Sources.
However when I do that, my other files report saying folder is not under the declared package name.
This is specific to Play framework. Appreciate assistance :)
In the Project view, is the ´app´ folder marked in blue as in the image?
Alternatively, create the project from the command line with ´activator new ´. In IntelliJ, you can then select either the root folder or the build.sbt to open the project.
In both cases, app should be marked in blue, indicating it's a source directory.
It's also possible you tried to create the Java file while IntelliJ was still initializing the project - during this time, it's not possible to create source files of any type.

Dart packages problems with intellij IDEA

I'm actually trying to use Dart in IntelliJ IDEA, and I have successfully install the plugin for it, but I face numerous others problems.
But the problem I want to resolve the most, is the fact that for some packages, IntelliJ doesn't show the sources inside it and not with particular reason...
The whole project work in Dart Editor, and launch correctly, so the problem is not from pubspec.yaml.
To makes me more understandable, I will say that I "pub get" correctly the packages A and B, so they appear as folder link in IntelliJ :
http://imgur.com/rb0ZSVA
But like you see, I cannot enter in the b package to see the files inside it. I have checked the structure of the two folders without noticing any difference.
The more ridiculous in that is, I can see some of the files inside the B package in the editor of IntelliJ via Ctrl+Click in the dart files that import the files inside the B package. And it doesn't work for all of them ...
'b' is a 'path package' in your project. That means that b original source code is located on your computer and you specified path to it in pubspec.yaml. IntelliJ IDEA excludes all copies and leaves only original files in project. Root 'packages' folder is not excluded, but all its copies (for example in web folder) are excluded. packages/b is a copy and it is excluded. To work normally with source files from b package you should add path to b as a separate content root: Project Structure | Modules | your Dart module | Add content root.
In IntelliJ IDEA 14 excluded folders are visible by default. Use cases when you need to see excluded folder contents are rare so you may safely hide them (the option is under the gear in the Project View tool window title). With it you will see empty node in packages/b with a hint that it is just a link to b/lib folder. And anyway you should have path to b configured as a content root.
You should not open files of projects currently open in IntelliJ from the package folder but instead directly from the project. The b/lib after the folder icon indicates that this package is part of your currently opened IntelliJ project (may added as a Resource Root)
When you navigate to a referenced file ctrl+click the file is not opened from the packages symlink but from the package in your IntelliJ project (as you should do it manually as well).
The solution is to update IntelliJ to the Early Access update (139.2).
So this question will be useless in the next update, I will delete her at that moment.

IDEA: How do I see subdirectories in an empty project?

I wish to use IDEA to edit a directory full of files of no particular type. So, I create a new project of type Empty Project and point it at my directory.
The project view now shows the files in the directory itself. But, it doesn't show any subdirectories. This is very strange.
Even more strangely, I can still use New -> Directory to create a new directory. From the command line I can see that the directory has been created; but, from within IDEA, it's still not appearing.
What's going on here? And, more importantly, how can I actually get it to show me my subdirectories?
This is IntelliJ IDEA 12.1.1. I did find IntelliJ does not show project folders, which sounds similar. But, it is referring to a different version of IDEA and they're not using an Empty Project. So, I don't think it's relevant.
In IntelliJ, you have to create at least one module. As CrazyCoder said in the comments, adding a module sets the root folder of what to display in the Project pane.
Here are steps that I took to show empty folders.
In a terminal window
mkdir one
mkdir one/two
mkdir one/two/three
mkdir one/two/three/four
In Intellij 15.0.2, I created a new project, selected Empty Project and set the Project Location to the one folder.
After creating the project, IntelliJ prompts me with a Project Structure dialog with Modules selected in the navigation tree. I clicked the '+' button in the middle pane to add a module. I chose Static Web as the module type to prevent creation of an additional src folder. I set the Content root and the Module file location of the module to the same one folder.
I clicked Finish and then Ok. This gave me this structure