Yes, I did some to automate common tasks in my current project. They were pretty simple and work fine, though I miss "Create file from LT" feature, posted to tracker separately. I have many common files, specifically business entities, collections of them, helper classes and such. Ideally, I would like to have "Create file from LT" and completely drop VS built-in features like "Add class" and other. I already changed VS default templates for such things, but this is still not enough. There are several common scenarious which could be covered by Resharper's LT and make life easier. I will try more LTs in the nearest future.
Yes, I did some to automate common tasks in my current project. They were
pretty simple and work fine, though I miss "Create file from LT" feature, posted to tracker separately. I have many common files, specifically business entities, collections of them, helper classes and such. Ideally, I would like to have "Create file from LT" and completely drop VS built-in features like "Add class" and other. I already changed VS default templates for such things, but this is still not enough. There are several common scenarious which could be covered by Resharper's LT and make life easier. I will try more LTs in the nearest future.
VK> Do you find live templates configruation UI hard to learn/use or VK> not? Any feedback would be appreciated.
The main issue is: you have to know that macros are surrounded with $. You can guess it from viewing existing templates, but the "Edit Template" dialog by itself does not present any single hint for this.
Also, the "Editable field" control looks and works quite ugly (the text in the cell jumping as you click on it, borders not drawn properly etc.). A simple checkbox embedded in the table cell would be much more convenient.
The "Choose macro" dialog would be better with some explanation text and examples.
The width of table cells jumping as I change macros also doesn't look nice. The "Editable field" column does not need to be resizable at all, and the size of the Name column can probably be adjusted only manually.
-- Dmitry Jemerov OmniaMea Project Leader JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
1. Edit template dialog should not be modal. The problem is that I often want to look at existing LT when creating new one and I have to close dialog, look at desired template and reopen it.
2. Add buttons to template edit window to insert predefined macros, such as $END$, with tooltips explaining them
3. Add description to choose macro dialog, explaining what this macro does and an example
4. Mouse wheel doesn't work in list of LTs
5. In LT preview window underline editable place, like in editor. Ideally, in edit window right click on the non-underlined macro should bring popup menu with "make this editable" choice. It is not very convenient to count usages of macro and selecting number.
6. For dictionary enumeration, it should allow to guess key and value type, like in collection enumeration
7. Add more macros (more discussion needed). One that I personally miss, is "Suggest type assignable to ]]>". E.g. for "using" LT I need only IDisposable types. Also method-related macros are missed (including constructor). E.g. for "new object" LT ($TYPE$ $VAR$ = new $TYPE$()) I'd like to select type, have suggested var AND select constrcutor.
8. After edit LT grid is positioned on the first element.
Ilya, thanks for your feedback! See my comments below.
1. Edit template dialog should not be modal. The problem is that I often
want to look at existing LT when creating new one and I have to close dialog, look at desired template and reopen it.
We'll do that.
>
2. Add buttons to template edit window to insert predefined macros, such
as $END$, with tooltips explaining them
We'll think about that.
>
3. Add description to choose macro dialog, explaining what this macro does
and an example
Will be implemented.
>
4. Mouse wheel doesn't work in list of LTs
We'll try to fix that.
>
5. In LT preview window underline editable place, like in editor.
We'll add it.
Ideally, in edit window right click on the non-underlined macro should
bring popup menu with "make this editable" choice. It is not very convenient to count usages of macro and selecting number.
I do not think many user will guess to invoke popup menu there. Usually there are not too big numbers and you immediately see the feedback (underlined) after selecting a value.
>
6. For dictionary enumeration, it should allow to guess key and value
type, like in collection enumeration
There is such request in the tracker already.
>
7. Add more macros (more discussion needed). One that I personally miss,
is "Suggest type assignable to ]]>". E.g. for "using" LT I need only IDisposable types.
Could you please provide more information about this "using" template. I'm not sure I understand where such macro is needed in it.
Also method-related macros are missed (including constructor). E.g. for
"new object" LT ($TYPE$ $VAR$ = new $TYPE$()) I'd like to select type, have suggested var AND select constrcutor.
What does it mean "to select constructor"? What will be done after selecting a constructor?
>
8. After edit LT grid is positioned on the first element.
I could not reproduce that on my current build. Probably it's fixed already.
-- Valentin Kipiatkov Chief Scientist, Vice President of Product Development JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"
1. Edit template dialog should not be modal. The problem is that I often
want to look at existing LT when creating new one and I have to close dialog, look at desired template and reopen it. >
2. Add buttons to template edit window to insert predefined macros, such
as $END$, with tooltips explaining them >
3. Add description to choose macro dialog, explaining what this macro does
and an example >
4. Mouse wheel doesn't work in list of LTs
>
5. In LT preview window underline editable place, like in editor. Ideally,
in edit window right click on the non-underlined macro should bring popup menu with "make this editable" choice. It is not very convenient to count usages of macro and selecting number. >
6. For dictionary enumeration, it should allow to guess key and value
type, like in collection enumeration >
7. Add more macros (more discussion needed). One that I personally miss,
is "Suggest type assignable to ". E.g. for "using" LT I need only
IDisposable types. Also method-related macros are missed (including
constructor). E.g. for "new object" LT ($TYPE$ $VAR$ = new $TYPE$()) I'd
like to select type, have suggested var AND select constrcutor.
>]]>
8. After edit LT grid is positioned on the first element.
I do not think many user will guess to invoke popup menu there. Usually there are not too big numbers and you immediately see the feedback (underlined) after selecting a value.
First, many users will try popup menus, when they see "rich" editor. And it appears to be "rich" with colors and highlights. Second, there could be more actions, like "Cursor here", that inserts (or moves!) $END$ macro. Third, I suppose people will create LTs from existing code and thus they need to copy code into editor and then "mark" several things with macros. So I would select real type, hit right mouse button, and use "Change to macro". Then, all occurences of this type should be changed to macro. Then I click in other place, and hit "Cursor here" from popup menu. Then I will assign macros as needed and I'm done.
Method-related macros. I'm not yet sure, that's just a guess of what might be needed. We can select types, and variable, but not methods in LT. I just feel that it is missing.
Ah, and we definitly need parameters! For example, I would like to have LT for checking that value passed to public API is non-null. I'd have something like:
And "current line number" should have its fellows "current file name", "current project name". However I see little value in these, becaue after code is edited line number will be broken, and copy-paste can break file and project...
I see your case now. Unfortunately we cannot search all subtypes of particular type efficiently enough to allow such macro. So it should wait until will be able to do this (we plan this).
-- Valentin Kipiatkov Chief Scientist, Vice President of Product Development JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"
Yes, I also see little sense in "current line number" macro. Maybe we should drop it. "Current file name" and others probably make sense. There can be also "current date", "current date/time", "current user name" etc.
-- Valentin Kipiatkov Chief Scientist, Vice President of Product Development JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"
And "current line number" should have its fellows "current file name",
"current project name". However I see little value in these, becaue after code is edited line number will be broken, and copy-paste can break file and project...
On MY computer, I didn't notice any case when this operation is slow. Actually, openning inheritors for Object takes about 400 ms, and this one is probably the longest.
May be this could be option-controlled, so users of slow computers don't suffer?
We actually are working on the documentation but it's not ready yet. Has
anyone managed to create custom templates? Any feedback?
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:9081212.1084460538862.JavaMail.itn@is.intellij.net...
Yes, I did some to automate common tasks in my current project. They were pretty simple and work fine, though I miss "Create file from LT" feature, posted to tracker separately. I have many common files, specifically business entities, collections of them, helper classes and such. Ideally, I would like to have "Create file from LT" and completely drop VS built-in features like "Add class" and other. I already changed VS default templates for such things, but this is still not enough. There are several common scenarious which could be covered by Resharper's LT and make life easier. I will try more LTs in the nearest future.
Do you find live templates configruation UI hard to learn/use or not? Any
feedback would be appreciated.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:4177416.1085043141756.JavaMail.itn@is.intellij.net...
pretty simple and work fine, though I miss "Create file from LT" feature,
posted to tracker separately. I have many common files, specifically
business entities, collections of them, helper classes and such. Ideally, I
would like to have "Create file from LT" and completely drop VS built-in
features like "Add class" and other. I already changed VS default templates
for such things, but this is still not enough. There are several common
scenarious which could be covered by Resharper's LT and make life easier. I
will try more LTs in the nearest future.
Hello Valentin,
VK> Do you find live templates configruation UI hard to learn/use or
VK> not? Any feedback would be appreciated.
The main issue is: you have to know that macros are surrounded with $. You can guess it from viewing existing templates, but the "Edit Template" dialog by itself does not present any single hint for this.
Also, the "Editable field" control looks and works quite ugly (the text in the cell jumping as you click on it, borders not drawn properly etc.). A simple checkbox embedded in the table cell would be much more convenient.
The "Choose macro" dialog would be better with some explanation text and examples.
The width of table cells jumping as I change macros also doesn't look nice. The "Editable field" column does not need to be resizable at all, and the size of the Name column can probably be adjusted only manually.
--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
1. Edit template dialog should not be modal. The problem is that I often want to look at existing LT when creating new one and I have to close dialog, look at desired template and reopen it.
2. Add buttons to template edit window to insert predefined macros, such as $END$, with tooltips explaining them
3. Add description to choose macro dialog, explaining what this macro does and an example
4. Mouse wheel doesn't work in list of LTs
5. In LT preview window underline editable place, like in editor. Ideally, in edit window right click on the non-underlined macro should bring popup menu with "make this editable" choice. It is not very convenient to count usages of macro and selecting number.
6. For dictionary enumeration, it should allow to guess key and value type, like in collection enumeration
7. Add more macros (more discussion needed). One that I personally miss, is "Suggest type assignable to ]]>". E.g. for "using" LT I need only IDisposable types. Also method-related macros are missed (including constructor). E.g. for "new object" LT ($TYPE$ $VAR$ = new $TYPE$()) I'd like to select type, have suggested var AND select constrcutor.
8. After edit LT grid is positioned on the first element.
More to come :)
can guess it from viewing existing templates, but the "Edit Template" dialog
by itself does not present any single hint for this.
That's true but I could not imagine what we could do with that. Any ideas?
>
the cell jumping as you click on it, borders not drawn properly etc.). A
simple checkbox embedded in the table cell would be much more convenient.
We'll try to make it better. However, the checkbox is not suitable because
for macros having multiple occurences it contains the number.
>
examples.
Thanks for your suggestion, we'll add it.
>
nice. The "Editable field" column does not need to be resizable at all, and
the size of the Name column can probably be adjusted only manually.
You are right, we'll fix that.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c8i3bs$s9n$1@is.intellij.net...
>
>
can guess it from viewing existing templates, but the "Edit Template" dialog
by itself does not present any single hint for this.
>
the cell jumping as you click on it, borders not drawn properly etc.). A
simple checkbox embedded in the table cell would be much more convenient.
>
examples.
>
nice. The "Editable field" column does not need to be resizable at all, and
the size of the Name column can probably be adjusted only manually.
>
Ilya, thanks for your feedback! See my comments below.
want to look at existing LT when creating new one and I have to close
dialog, look at desired template and reopen it.
We'll do that.
>
as $END$, with tooltips explaining them
We'll think about that.
>
and an example
Will be implemented.
>
We'll try to fix that.
>
We'll add it.
bring popup menu with "make this editable" choice. It is not very convenient
to count usages of macro and selecting number.
I do not think many user will guess to invoke popup menu there. Usually
there are not too big numbers and you immediately see the feedback
(underlined) after selecting a value.
>
type, like in collection enumeration
There is such request in the tracker already.
>
is "Suggest type assignable to ]]>". E.g. for "using" LT I need only
IDisposable types.
Could you please provide more information about this "using" template. I'm
not sure I understand where such macro is needed in it.
"new object" LT ($TYPE$ $VAR$ = new $TYPE$()) I'd like to select type, have
suggested var AND select constrcutor.
What does it mean "to select constructor"? What will be done after selecting
a constructor?
>
I could not reproduce that on my current build. Probably it's fixed already.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:23871212.1085052039426.JavaMail.itn@is.intellij.net...
want to look at existing LT when creating new one and I have to close
dialog, look at desired template and reopen it.
>
as $END$, with tooltips explaining them
>
and an example
>
>
in edit window right click on the non-underlined macro should bring popup
menu with "make this editable" choice. It is not very convenient to count
usages of macro and selecting number.
>
type, like in collection enumeration
>
is "Suggest type assignable to ". E.g. for "using" LT I need only IDisposable types. Also method-related macros are missed (including constructor). E.g. for "new object" LT ($TYPE$ $VAR$ = new $TYPE$()) I'd like to select type, have suggested var AND select constrcutor. >]]>
>
Separate replies to maintain discussion...
First, many users will try popup menus, when they see "rich" editor. And it appears to be "rich" with colors and highlights. Second, there could be more actions, like "Cursor here", that inserts (or moves!) $END$ macro. Third, I suppose people will create LTs from existing code and thus they need to copy code into editor and then "mark" several things with macros. So I would select real type, hit right mouse button, and use "Change to macro". Then, all occurences of this type should be changed to macro. Then I click in other place, and hit "Cursor here" from popup menu. Then I will assign macros as needed and I'm done.
using template might look like this:
using($TYPE$ $VAR$ = new $TYPE($END$))
{
}
Here $TYPE$ should be "type, assignable to IDisposable" and $VAR$ suggested from $TYPE$.
Actually, this is artificial example. In my project I see many applications of such macro, but I can't publish info about them.
Method-related macros. I'm not yet sure, that's just a guess of what might be needed. We can select types, and variable, but not methods in LT. I just feel that it is missing.
Ah, and we definitly need parameters! For example, I would like to have LT for checking that value passed to public API is non-null. I'd have something like:
And "current line number" should have its fellows "current file name", "current project name". However I see little value in these, becaue after code is edited line number will be broken, and copy-paste can break file and project...
I see your case now. Unfortunately we cannot search all subtypes of
particular type efficiently enough to allow such macro. So it should wait
until will be able to do this (we plan this).
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:27082896.1085063005929.JavaMail.itn@is.intellij.net...
>
>
suggested from $TYPE$.
>
applications of such macro, but I can't publish info about them.
>
>
be needed. We can select types, and variable, but not methods in LT. I just
feel that it is missing.
Could you provide any usecase?
for checking that value passed to public > API is non-null. I'd have
something like:
Well, this can easily be implemented. Please post a feature request.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:18005340.1085063288967.JavaMail.itn@is.intellij.net...
be needed. We can select types, and variable, but not methods in LT. I just
feel that it is missing.
>
for checking that value passed to public API is non-null. I'd have something
like:
>
Yes, I also see little sense in "current line number" macro. Maybe we should
drop it. "Current file name" and others probably make sense. There can be
also "current date", "current date/time", "current user name" etc.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:30503638.1085063568882.JavaMail.itn@is.intellij.net...
"current project name". However I see little value in these, becaue after
code is edited line number will be broken, and copy-paste can break file and
project...
Hmm, isn't it the same as when "Goto inheritors" used?
I've submited an SCR:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=2664
You can add more suggestions (of similar macros) as comments.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Valentin Kipiatkov (JetBrains)" <valentin@intellij.com> wrote in message
news:c8im5v$ogl$1@is.intellij.net...
should
>
>
>
and
>
>
Yes, it's the same. Is it ALWAYS fast enough?
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Ilya Ryzhenkov" <no_mail@jetbrains.com> wrote in message
news:17305866.1085071006850.JavaMail.itn@is.intellij.net...
On MY computer, I didn't notice any case when this operation is slow. Actually, openning inheritors for Object takes about 400 ms, and this one is probably the longest.
May be this could be option-controlled, so users of slow computers don't suffer?