-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any suggestion / feature request? #11
Comments
It will be nice to have a editor for all rules and also if you can add alias to these rules |
how about adding
aside: I'm doing a R# "magic show" talk next month, I'm going to be showcasing super cool stuff that people familiar with R# didn't know they could do. I plan to feature your plugin. Any thing that you think really shines above the rest, please let me know. |
@Eonasdan, DbSet is great example for ReSharper live templates, but not for ZenSharp. Just create Live template as described here - https://www.jetbrains.com/resharper/help/Templates__Creating_and_Editing_Templates__Creating_a_Live_Template_from_Source_Code.html |
why do feel that way? ZenSharp already does property generation like that. I tried
but I the template doesn't show a name and it doesn't generate code. I'm trying to understand how to add custom items to your template. |
ah... I see now why you said that. ZenSharp wouldn't be able to figure out that type is a Model class? the generated code should be Can I make ZenSharp do that or do I really just need a live template? |
Looks like you really need just a live template. Create live template |
@adeel41 , For implement it really cool and useful feature I need to rewrite ZenSharp from scratch. As workaround I can suggest syntax highlight rules for VIM -- https://github.com/ulex/ZenSharp/blob/126817389e719811869cbd4fd28eb1bd9d37f62c/ZenSharp.Core/ltg.vim |
Hello i would like to create method what return the array for example int array. |
Now i want to made it work untill 5 variables and with ref out and params |
Super simple |
@GeorgeWolf, Thank you for your feedback! Default templates allow you to enter array type by entering
you should type Nice idea with Did you really find 5 parameters completion useful? From my point of view, much |
By the way i am really big fun of using IDE so i rewrite almost vsVim for my self. To make it perfect. |
Thanks for the great extension. |
@olsh sorry for long answer. Currently, async templates not included in predefined templates. But they are pretty easy to add. this can be achieved by simple change in templates: diff --git a/ZenSharp.Integration/Templates.ltg b/ZenSharp.Integration/Templates.ltg
index 7aef698..0eb368f 100644
--- a/ZenSharp.Integration/Templates.ltg
+++ b/ZenSharp.Integration/Templates.ltg
@@ -17,6 +16,7 @@ maybeType ::= type | "void"
type ::= generic | primType ("?"="?")? ("[]"=a)? | suggType
primType ::= string=s | byte=by | bool=b | "System.DateTime"=dt | decimal=dc | double=d | int=i | uint=ui | "System.Guid"=g | "System.Uri"=u | "System.Xml.Linq.XElement"=x |
object=o
+taskType ::= "System.Threading.Tasks.Task"
// Complex types:
generic1 ::= (SCG "." ("IList"=l | "IEnumerable"="~")) "<" type ">"
@@ -40,7 +40,9 @@ methodAttributes ::=
| "[NUnit.Framework.TearDownAttribute]"=td
| "[NUnit.Framework.TestCaseAttribute]"=tc
| "[NUnit.Framework.TestAttribute]"=t
-method ::= (methodAttributes)? access ("virtual "=vm | "abstract "=am | "static "=M | ""=m) (type | "void") space identifier methodArgs methodBody
+method_async ::= (methodAttributes)? access "async" space ("virtual "=vm | "abstract "=am | "static "=M | ""=m) (taskType "<"=T type ">" | taskType ""=T) space identifier methodArgs methodBody
+method_generic ::= (methodAttributes)? access ("virtual "=vm | "abstract "=am | "static "=M | ""=m) (type | "void") space identifier methodArgs methodBody
+method ::= method_async | method_generic
methodBody ::= " { " cursor " }"
methodArgs ::= "(" ((""="," | ""="(") arg)? ")"
arg ::= primType " " identifier2 |
I want to generate properties with PropertyChanged notifications. Here's the code transformation I want to achieve: private string _value;
public string Value
{
get { return _value; }
set
{
if (value == _value) return;
_value = value;
OnPropertyChanged(nameof(Value));
}
} Any way to do it with ZenSharp? I know it can be done with live templates or either with |
@ilivit sorry, but currently it is not possible due bug in templates substitution (you need to substitute type twice in single template). |
Hello. I really enjoy your extension. Is there some way to detect in-method or in-property scope? |
@amadare42 Unfortunately not. |
Hi! Any idea? 😄 Edit: I wrote a post about ZenSharp templates with more examples: https://garyng.github.io/gtil-gitbook/ReSharper/resharper-plugin-zensharp.html |
@garyng this is just conflict of priorities. You can modify your ltg file this way to fix it:
I would be nice to have some automatic verification tool to find such conflicts 😄
thanks, I have added link to the |
Is anyone except me using ZenSharp in production environment?
Do you have any suggestion?
I'm will be very happy to any feedback.
The text was updated successfully, but these errors were encountered: