"Choose destination folder" dialog on creating class

Answered

The Choose destination folder dialog that pops up every time I want to create a new class totally annoys me. For me, the only two source paths are my normal sourcepath and my test sourcepath. I never want to create classes in my test path aside from a single SelfTest class in packages with classes which require testing.

What does anyone else think? I had a few ideas:
1. Integrate the choose destination folder listbox into the New Class dialog
2. Make separate New->Class and New->Test Class

I wonder if this dialog bothers anyone else, and if anyone else has any ideas.

0
13 comments
Avatar
Permanently deleted user

Keith Lea wrote:

>The Choose destination folder dialog ..
>anyone else has any ideas?

>

What would be nice, and would solve this "problem", would be add a way,
in "File Template", to specify the default destination of the new file.
The best location for a new "build.xml" won't be the same as for a new
"todo.txt" files, of "index.html"

I'd suggest to
- use $macros$,
that could be
- relative to the current editor/file/class/module
(ex: "$thisModuleTestOutputPath$/")
- absolute
(ex: $project$/resource)


In this context, it would make sense to make this info - File Templates
- project related.

Alain

0
Avatar
Permanently deleted user

That dialog really hasn't bugged me. Most of the time the source path I
intend (normal vs. test) is initially selected, so it is easy to say "Yep,
that's right; continue" (either via Return or Ctrl-Return; I'm not at work
right now).

WRT to new classes in the test sourcepath, are you really saying that you
only have one test class (SelfTest) per package? If so, I think that may be
atypical.

Kendall

"Keith Lea" <keith@cs.oswego.edu> wrote in message
news:8796733.1076471515544.JavaMail.itn@is.intellij.net...

The Choose destination folder dialog that pops up every time I want to

create a new class totally annoys me. For me, the only two source paths are
my normal sourcepath and my test sourcepath. I never want to create classes
in my test path aside from a single SelfTest class in packages with classes
which require testing.
>

What does anyone else think? I had a few ideas:
1. Integrate the choose destination folder listbox into the New Class

dialog

2. Make separate New->Class and New->Test Class

>

I wonder if this dialog bothers anyone else, and if anyone else has any

ideas.


0
Avatar
Permanently deleted user


Keith Lea wrote:

1. Integrate the choose destination folder listbox into the New Class dialog


I like this idea. No need for two seperate dialogs.

0
Avatar
Permanently deleted user

1. Integrate the choose destination folder listbox into the New Class

dialog
>

I like this idea. No need for two seperate dialogs.

>

This sounds nice, integrate it and show it only if multiple options are
available.
Is there a request number already (so I can vote for it :)?

Andrei


0
Avatar
Permanently deleted user

Pardon my ignorance here, but how are you getting this double dialog? When I create new classes I am already in the directory I want to create it and it gets created there.

0
Avatar
Permanently deleted user

Try a new class from the package view, on a package that exists in multiple
source paths (in different modules, for example).

Andrei

"Patrick Burleson" <pbur@yahoo.com> wrote in message
news:27525958.1076527322259.JavaMail.itn@is.intellij.net...

Pardon my ignorance here, but how are you getting this double dialog? When

I create new classes I am already in the directory I want to create it and
it gets created there.


0
Avatar
Permanently deleted user

Ah, ok. I don't have that issue yet. Mostly because we don't have test cases.

0

My problem is even worse than that of the author of the post. Something happened with the project settings (I don't know where exactly) and every time I want to create a class "Target destination directory" points to test directory (green marked ...\src\test\...). Every time I need to switch it manually to blue marked ...\src\main\...

0

Vsevols how exactly do you create a class? Please provide the steps to reproduce this issue.

0

Serge Baranov

I'm having the same issue as Vsevols. I'd like my IntellJ to remember the destination directory I used recently, or to let me configure it for each sources root independently. Steps to reproduce:

  1. Create a new test class in test sources root.
  2. Create any test inside the test class.
  3. Inside the body start writing the name of the class that doesn't exist yet. The code should not compile yet.
  4. Point to the non-existent class name and invoke context actions and choose "Create class ...". The destination directory should be the test sources root directory.
  5. Change destination directory it to the main sources root directory.
  6. Repeat 3 and 4. The destination directory is still pointing to test sources root directory, while I'd like it to be the main sources root directory.

It used to work like I want it in the past. It broke with one of the recent updates. I'd greatly appreciate your help.

0

Hi Goobar,

Indeed, it used to work differently in the previous versions.

I submitted a new report for this issue to our tracking system: https://youtrack.jetbrains.com/issue/IDEA-302497

Responsible developers will look into it shortly. 

Feel free to leave additional comments in the issue. See this article if you are not familiar with YouTrack.

0

Please sign in to leave a comment.