1

Topic: in a Visual Studio 2013

Good afternoon. Colleagues, prompt convenient means for  compatible to a Visual Studio 2013. At my instruction last ReSharper, studio, any free a software and direct hands. T4 not to offer. It is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. It would be desirable to have complete control over text formation. A small example: the Lazy programmer writes: String hello = "Hello"; String world = "world"; Int32 count = 1; String result = client. Do (hello, world, count); Pushes Alt+Enter, receives: [Serializable] class DoSpec {[Serializable] String Hello {get;} [Serializable] String World {get;} [Serializable] Int32 Count {get;} public DoSpec (String hello, String world, Int32 count) {Hello = hello; World = world; Count = count;}} partial interface IClient {String Do (String hello, String world, Int32 count);} partial class Client1: IClient {public String Do (String hello, String world, Int32 count) {SendSpec spec = new SendSpec (hello, world, count); var result = _connection. Invoke (spec); return result. GetString ();}} partial class Client2: IClient {public String Do (String hello, String world, Int32 count) {_pipe. WriteString (0, hello); _pipe. WriteString (1, world); _pipe. WriteInt32 (2, count); return _pipe. ReadString ();}}

2

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> Colleagues, prompt convenient means for  compatible to a Visual Studio 2013. LW> At my instruction last ReSharper, studio, any free a software and direct hands. LW> T4 not to offer. LW> it is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW> It would be desirable to have complete control over text formation. Write simply console . It will be compatible to everything.

3

Re: in a Visual Studio 2013

Hello, vmpire, you wrote: LW>> It is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW>> It would be desirable to have complete control over text formation. V> write simply console . It will be compatible to everything. Than to cause the console utility from studio? How to transfer dependences (at least current line)?

4

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW>>> It is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW>>> It would be desirable to have complete control over text formation. V>> write simply console . It will be compatible to everything. LW> than to cause the console utility from studio? What for it is indispensable from studio? If from studio - add in external tools LW> How to transfer dependences (at least current line)? A current line of that? If windows of the editor - that $ (CurLine) or $ (CurText), looking what exactly it is necessary. By the way, the full statement of the problem is not clear: "to add in the project a file with new type and to modify 6 existing." 6 existing projects? Files? Types? From the point of view of Russian it is possible to understand all three methods.

5

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> It is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW> It would be desirable to have complete control over text formation. And how often and how it is necessary to do it? If it would be desirable to cause from studio hands  it is possible to write a plug-in to ReSharper. The console utility will precisely work, but there it is necessary to modify hands.csproj that in nontrivial cases can be uneasy and leads to project reboot in studio if it during this moment is opened. But if it is necessary for  it is possible to write build step, which new file in compilation adds. Or it is possible to use wildcard that design file not to modify.

6

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> T4 not to offer. Did not master or is any objective reasons not  the tool directly intended for generation?? Well here Perl is - it is compatible to any studio.

7

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> It is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW> It would be desirable to have complete control over text formation. You to us told it about hypothetical implementation of some task. And now tell to us about the task. You dare to solve what problem? And what for to you, thus, code generation?

8

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> Good afternoon. LW> colleagues, prompt convenient means for  compatible to a Visual Studio 2013. LW> At my instruction last ReSharper, studio, any free a software and direct hands. LW> T4 not to offer. LW> it is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW> It would be desirable to have complete control over text formation. Roslyn like is able

9

Re: in a Visual Studio 2013

Hello, VladD2, you wrote: VD> you to us told It about hypothetical implementation of some task. And now tell to us about the task. You dare to solve what problem? And what for to you, thus, code generation? And sense? Alternative decisions are, I know about them, they are pleasant to me, but apply them I cannot. I would solve the task with pleasure differently, but, alas, it is impossible. Therefore it is necessary to be repelled all the same from hypothetical implementation of some task by means .

10

Re: in a Visual Studio 2013

Hello, Kolesiki, you wrote: K> did not master or there are any objective reasons not  the tool directly intended for generation?? K> well here Perl is - it is compatible to any studio. Well, if to select between Perl and T4, a choice, unconditionally, towards the last. On T4 I can represent the elementary things, leaning against examples. Difficult - is not present. Whether probably to implement that I want on T4 - I do not know, most likely is not present. But I know beyond doubt that I do not want to learn two ten person  tool this awful and become outdated at the moment of a birth.> _> if it does not use even MS, well it .

11

Re: in a Visual Studio 2013

Hello, qxWork, you wrote: W> And how often and how it is necessary to do it? In process of code writing. In an ideal, from a menu on Alt+Enter, unfortunately, the functional live-template does not suffice. ((W> if it would be desirable to cause from studio hands  it is possible to write a plug-in to ReSharper. I think in this direction, but devil take it, I do not like a method  plug-ins to R#, not to mention what surrounding adjustment is any sheer hell, and  they till now not  (or something changed?). W> the console utility will precisely work, but there it is necessary to modify hands.csproj that in nontrivial cases can be uneasy and leads to project reboot in studio if it during this moment is opened. Reboot of projects does not arrange. Plus it is necessary to add manually integration with CVS (at least at level automatic  files).

12

Re: in a Visual Studio 2013

Hello, vmpire, you wrote: V> What for it is indispensable from studio? If from studio - add in external tools Because it would be desirable to have near at hand fast action to which can fulfill, pushing . V> the Current line of that? If windows of the editor - that $ (CurLine) or $ (CurText), looking what exactly it is necessary. . Interesting, it is necessary to try. Thanks! If other variants will not be, and I will arrive. But to assort a syntactic tree on the second time it would not be desirable... But it is all the same better, than anything! V> by the way, the full statement of the problem is not clear: "to add in the project a file with new type and to modify 6 existing." V> 6 existing projects? Files? Types? From the point of view of Russian it is possible to understand all three methods. From the point of view of the task, at all has no value, unless is not present?) But speech about existing types which as a first approximation can be accepted for files, even with constant ways though from it, of course, it would be desirable to leave.

13

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> T4 not to offer. A standard choice - T4, Fody (if il rewrite does not confuse), pre-build script in which it is possible to fasten everything up to . All remaining will be strong worse on convenience/presence of unpleasant surprises. And than T4 it is bad?

14

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: V>> What for it is indispensable from studio? If from studio - add in external tools LW> Because it would be desirable to have near at hand fast action to which can fulfill, pushing . Just in case: on external tools too it is possible to hang up

15

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> On T4 I can represent the elementary things, leaning against examples. Difficult - is not present. Whether probably to implement that I want on T4 - I do not know, most likely is not present. Probably not in a subject, but is VisualStudioHelper https://stackoverflow.com/questions/186 … ual-studio https://msdn.microsoft.com/ru-ru/librar … ction.aspx https://github.com/AndersMalmgren/T4Tem … .ttinclude

16

Re: in a Visual Studio 2013

Hello, vmpire, you wrote: V> Just in case: on external tools too it is possible to hang up  Aha, I know, therefore and told that it is a variant.

17

Re: in a Visual Studio 2013

Hello, Sinix, you wrote: S> the Standard choice - T4, Fody (if il rewrite does not confuse), pre-build script in which it is possible to fasten everything up to . IL does not confuse, but the files of source codes generated on , instead of code/assemblages autogeneration are necessary. Otherwise all would be much easier. And at  appeared adequate API for creation of trees? About half a year back I tried to represent on it something elementary, like a class with the designer which arguments register in properties with a private setter, and already on this place  for lack of examples or intuitively clear API. It not seems, just could change the modifier of a setter. S> and than T4 it is bad? At first, MS in the same  it does not use, and writes the code simply through TextWriter that guards. Secondly, I do not know it, it is necessary to master, collecting all possible rake, and not the fact that as a result it turns out to implement the conceived. The user writes: IInterface nt = new MyType (); nt. DoSomething (arg1, arg2, arg3); pushes ,  a method with the necessary signature on the basis of the transferred arguments in IInterface, and its implementations in all known successors of the given interface. Thirdly, syntax T4 looks very untidily. It repels. How to convince some tens developers to support this rubbish if you throws from it in a shiver?

18

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> At first, MS in the same  it does not use, and writes the code simply through TextWriter that guards. https://www.hanselman.com/blog/T4MVCAnd … lpers.aspx

19

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> IL does not confuse, but the files of source codes generated on , instead of code/assemblages autogeneration are necessary. Otherwise all would be much easier. Then either , or t4, or exotic. The people like something on Razor modeled from a hopelessness. LW> and at  appeared adequate API for creation of trees? About half a year back I tried to represent on it something elementary, like a class with the designer which arguments register in properties with a private setter, and already on this place  for lack of examples or intuitively clear API. It not seems, just could change the modifier of a setter. There is no certainly Normally all it is reduced to preparation parsing (a piece of the code in the form of a line) and  . S>> And than T4 it is bad? LW> At first, MS in the same  it does not use, and writes the code simply through TextWriter that guards. Well so scenarios generally-in general the different. Logically like) LW> Secondly, I do not know it, it is necessary to master, collecting all possible rake, and not the fact that as a result it turns out to implement the conceived. Yes there is in it nothing difficult. Banal sugar for text writer, no more that. For quickly  other version from the ready code or to receive the beautiful code on  - it. It is unique, T4 it is not necessary for "to receive AST and something with it to make", all at level . In CodeJam examples full, look.tt - files. LW> the user writes: IInterface nt = new MyType (); nt. DoSomething (arg1, arg2, arg3); LW> Pushes ,  a method with the necessary signature on the basis of the transferred arguments in IInterface, and its implementations in all known successors of the given interface. And here it the ideal scenario for Roslyn analyser-a is direct. Or what extensions.  from a box .

20

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: VD>> you to us told It about hypothetical implementation of some task. And now tell to us about the task. You dare to solve what problem? And what for to you, thus, code generation? LW> and sense? People can answer you more intelligently. Often such questions arise because of the incorrect selected approach or not a true estimation of the task. LW> I would solve the task with pleasure differently, but, alas, it is impossible. Why? LW> therefore it is necessary to be repelled all the same from hypothetical implementation of some task by means .  too different happens. So you nevertheless describe the task. Something can we to you more efficient we prompt.

21

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> T4 not to offer. It you in vain. The reliable piece, works well and everywhere. In VS 2017 generally from a box goes to configurations on-default.

22

Re: in a Visual Studio 2013

Hello, Aquilaware, you wrote: A> It you in vain. The reliable piece, works well and everywhere. In VS 2017 generally from a box goes to configurations on-default. Already wrote repeatedly: badly it works, not everywhere. http://rsdn.org/forum/dotnet/6752924.1 the Author: Mr. Delphist Date: 10.04.17

23

Re: in a Visual Studio 2013

Hello, VladD2, you wrote: VD> Kodogeneratsija too different happens. So you nevertheless describe the task. Something can we to you more efficient we prompt. There is a remote base of the data to which it is necessary to fulfill the parametrized requests, modifying them both on client side, and on server side. All on bicycles. Indirect decisions, normal ORM, LINQ/IQuerable etc. do not approach because of problems with licensing, certification, internal policy or moral restrictions. Well and than here you will help, except change of a place of operation?

24

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> There is a remote base of the data to which it is necessary to fulfill the parametrized requests, modifying them both on client side, and on server side. LW> All on bicycles. Indirect decisions, normal ORM, LINQ/IQuerable etc. do not approach because of problems with licensing, certification, internal policy or moral restrictions. Well and than here you will help, except change of a place of operation? And what problems with  can be at LINQ? Actually I, in your case, just also would advise to use LINQ + code generation on the basis of trees of expressions (ET). You create the assembly through a reflection (DefineDynamicAssembly/DefineDynamicModule/DefineType/DefineMethod) and you use method CompileToMethod at ET. Further you read meta data of a DB and you generate the necessary methods. 4 here too would approach. If it is not terrible to involve Nemerle, it generally the ideal decision for similar tasks. Here very similar example.

25

Re: in a Visual Studio 2013

Hello, VladD2, you wrote: VD> Actually I, in your case, just also would advise to use LINQ + code generation on the basis of trees of expressions (ET). You create the assembly through a reflection (DefineDynamicAssembly/DefineDynamicModule/DefineType/DefineMethod) and you use method CompileToMethod at ET. Further you read meta data of a DB and you generate the necessary methods. VD> 4 here too would approach. VD> If it is not terrible to involve Nemerle, it generally the ideal decision for similar tasks. Here very similar example. And, as I described, anything from this does not approach. I too would take for basis LINQ. Alas. (