File Templates: feature request

I have a small feature request concerning File Templates. Currently the templates
produce the namespace of newly created class by combiing the default project
namespace with folder structure. Actually, it mimics the behavior of VS.

Unfortunatly this may be somewhat inconvenient. In our projects we use a
top-level folder called 'Sources' to store the source files -- just to keep
them separate from resources, project files etc. And, as I understand, at
Jetbrains you also use some similar scheme (src folder).

So the suggestion is: add an option which allows the macro to skip some top-level
folders while constructing the namespace. It might be:
1) an option to ignore the top-level folder
2) a integer number specifying the depth of folders to ignore
3) a regexp specifying the prefix which should be dropped

Regards,
Maxim.


6 comments
Comment actions Permalink

I'm second for this. I think this option could have a form of regexp indicating which folders should be skipped when generating the namespace name

0
Comment actions Permalink

Hello Dmitry,

Since the idea seems reasonable, I have submitted a request into the tracker.


0
Comment actions Permalink

How about getting the namespace from the files that are already in the folder?
This would work without any tuning.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello Dmitry,

Since the idea seems reasonable, I have submitted a request into the
tracker.



0
Comment actions Permalink

.... as long as the file being created is not the first one in the folder.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

How about getting the namespace from the files that are already in the
folder? This would work without any tuning.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> Hello Dmitry,
>>
>> Since the idea seems reasonable, I have submitted a request into the
>> tracker.
>>



0
Comment actions Permalink

... as long as the file being created is not the first one in the
folder.


Of course. But for the first file in the folder you can correct the namespace
manually. I'm afraid of having too much settings..

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

... as long as the file being created is not the first one in the
folder.

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> How about getting the namespace from the files that are already in
>> the folder? This would work without any tuning.
>>
>> Valentin Kipiatkov
>> Chief Scientist, Vice President of Product Development
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> Hello Dmitry,
>>>
>>> Since the idea seems reasonable, I have submitted a request into the
>>> tracker.
>>>


0
Comment actions Permalink

Hello Valentin,

Of course. But for the first file in the folder you can correct the
namespace manually. I'm afraid of having too much settings..


For the first file in the folder you may go one level up and examine the
parent folder. So actually the user will have to correct the namespace only
once per top-level folder (once per project in most scenarios).


0

Please sign in to leave a comment.