Help, function names, splitting strings etc.

Help
Marazo
2007-08-27
2013-04-17
  • Marazo

    Marazo - 2007-08-27

    Hi,

    I have functions named like readCnvDb, readItemDb and readCnvDrawPos.

    Can I somehow make template that would open the functions to something like "reads conveyor database", "reads item database" and "reads conveyor drawing positions"? The idea would be that the "read" is what triggers this template and then some code would extract the other words and open them.

    All I can whip up is something that ends in "reads Cnv Db", "reads Item Db" and "reads Cnv Draw Pos"...

    A little more complicated template would make this handy plugin even more usefull. I wouldnt wan't to write triggers for all the possible variations of Cnv, Db and what not...

    Thanks.

     
    • Martin Kesting

      Martin Kesting - 2007-09-01

      At the moment you have to define a template for every method you mentioned above.

      I think what you need is to define replacements for your special shortcuts, so that e.g. "Db" will always be expanded to "Database" in every template you use.

      There is already the possibility to define replacements, but it works only for the prefix of an element. I could enhance this functionality, so that every occurrence of a given shortcut will be replaced, when creating comment from element name.

      Will this fit your needs?

       
    • Martin Kesting

      Martin Kesting - 2007-09-09

      Should be solved with release 1.5. Define the following replacements to get the desired comments:

      Shortcut: db,   Replacement: database,  Scope: Method or Both, Replace: All
      Shortcut: cnv,  Replacement: conveyor,  Scope: Method or Both, Replace: All
      Shortcut: draw, Replacement: drawing,   Scope: Method or Both, Replace: All
      Shortcut: pos,  Replacement: positions, Scope: Method or Both, Replace: All

       
    • Marazo

      Marazo - 2007-10-01

      Thank you million times! This will help me alot and add a great deal of usability to your nice plugin.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks