Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#85 Code Templates: leading comments

closed-fixed
nobody
None
5
2015-02-24
2013-12-30
StevenAZ
No

It would be great to be able to add comments to templates. Take this for example:

/
* Function: ${function_name}
* A description here
*
* Parameters:
* ${variables} TODO: Add variable description

* Returns:
* ${return_type} - Add descrption here
/
function ${return_type} ${function_name} (${variables});
${insert_cursor_here}
endfunction

Related

Feature Requests: #85

Discussion

  • This one goes back to the fact that code-template insertion is currently
    triggered by the prefix of the template. It's pretty clear that this will
    need to be enhanced (seems JDT has a more-complex scheme)...

    On Mon, Dec 30, 2013 at 2:21 PM, StevenAZ stevenaz@users.sf.net wrote:


    Status: open
    Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
    Last Updated: Mon Dec 30, 2013 10:21 PM UTC
    Owner: nobody

    It would be great to be able to add comments to templates. Take this for
    example:

    /

      • Function: ${function_name} * A description here * Parameters:
        ${variables} TODO: Add variable description *
    • Returns:
    • ${return_type} - Add descrption here
      /
      function ${return_type} ${function_name} (${variables});
      ${insert_cursor_here}
      endfunction

    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/sveditor/feature-requests/85/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Feature Requests: #85

  • StevenAZ
    StevenAZ
    2013-12-31

    I'd say that priority wise, this is about as low as it gets.

     
    • Not necessarily... As it turns out, being able to insert code blocks
      independent of how they start (eg with a comment block) is pretty handy. It
      appears JDT provides some sort of multi-context content assist where you
      can page through various types of proposals. I'd agree that it's not top
      priority at the moment, but if code templates are an increasingly-useful
      feature, then improved support will be important...

      On Mon, Dec 30, 2013 at 8:48 PM, StevenAZ stevenaz@users.sf.net wrote:

      I'd say that priority wise, this is about as low as it gets.

      Status: open
      Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
      Last Updated: Mon Dec 30, 2013 10:21 PM UTC
      Owner: nobody

      It would be great to be able to add comments to templates. Take this for
      example:

      /

        • Function: ${function_name} * A description here * Parameters:
          ${variables} TODO: Add variable description *
      • Returns:
      • ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/sveditor/feature-requests/85/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #85

      Attachments
    • status: open --> closed-fixed
     
  • With the new support for multiple content-assist contexts in 1.5.0, template content assist can be provided based on the template ID. This allows code templates to begin with comments

     
  • StevenAZ
    StevenAZ
    2014-01-02

    Would the expected behavior be to hit Ctrl+Space twice to get access to these prototypes?

     
    • Yes. Content assist is triggered off the leading portion of the proposal
      for default content-assist proposals, and off the leading portion of the
      template name for Template proposals.

      On Wed, Jan 1, 2014 at 6:16 PM, StevenAZ stevenaz@users.sf.net wrote:

      Would the expected behavior be to hit Ctrl+Space twice to get access to
      these prototypes?


      Status: closed-fixed

      Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
      Last Updated: Thu Jan 02, 2014 12:30 AM UTC
      Owner: nobody

      It would be great to be able to add comments to templates. Take this for
      example:

      /

        • Function: ${function_name} * A description here * Parameters:
          ${variables} TODO: Add variable description *
      • Returns:
      • ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/sveditor/feature-requests/85/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #85

      Attachments
      • Okay, well that would be the right one. Sorry to question, just spent a
        bunch of time this afternoon trying to iron out issues that prevented the
        user from getting to the 'Template' tab J

        I'll have a look and let you know what I find.

        On Wed, Jan 1, 2014 at 6:42 PM, Matthew Ballance mballance@users.sf.netwrote:

        Yes. Content assist is triggered off the leading portion of the proposal
        for default content-assist proposals, and off the leading portion of the
        template name for Template proposals.

        On Wed, Jan 1, 2014 at 6:16 PM, StevenAZ stevenaz@users.sf.net wrote:

        Would the expected behavior be to hit Ctrl+Space twice to get access to
        these prototypes?


        http://sourceforge.net/p/sveditor/feature-requests/85/ Code Templates:
        leading comments*

        Status: closed-fixed

        Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
        Last Updated: Thu Jan 02, 2014 12:30 AM UTC
        Owner: nobody

        It would be great to be able to add comments to templates. Take this for
        example:

        /

        -
        - Function: ${function_name} * A description here * Parameters:
        ${variables} TODO: Add variable description *
        - Returns:
        - ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/sveditor/feature-requests/85/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/


        Status: closed-fixed
        Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
        Last Updated: Thu Jan 02, 2014 02:36 AM UTC
        Owner: nobody

        It would be great to be able to add comments to templates. Take this for
        example:

        /

          • Function: ${function_name} * A description here * Parameters:
            ${variables} TODO: Add variable description *
        • Returns:
        • ${return_type} - Add descrption here
          /
          function ${return_type} ${function_name} (${variables});
          ${insert_cursor_here}
          endfunction

        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/sveditor/feature-requests/85/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Feature Requests: #85

        Attachments
  • StevenAZ
    StevenAZ
    2014-01-02

    Been playing with this. Something not quite right. If I add a comment to ONE of the always blocks, it will only show up if I hit Ctrl+Space twice. If I add a comment to a a template that return at least 1 result initially (such as the final block in plugin I added earlier) you don't get a chance to hit Ctrl+Space the second time which will toggle the ability to insert the "final" code block with a comment.

    Have added an updated net.sf.sveditor.ui/plugin.xml to this comment. Try code completion always. Always_ff template has a leading comment. Then try "final", it also has a leading comment.

     
    Attachments
    • Are you fully up-to-date with Git trunk? I recently added some code to deal
      with some adverse effects of prefix auto-complete. I'd be interested to
      confirm whether you still see this behavior with the latest code.

      -Matthew

      On Wednesday, January 1, 2014, StevenAZ wrote:

      Been playing with this. Something not quite right. If I add a comment to
      ONE of the always blocks, it will only show up if I hit Ctrl+Space twice.
      If I add a comment to a a template that return at least 1 result initially
      (such as the final block in plugin I added earlier) you don't get a chance
      to hit Ctrl+Space the second time which will toggle the ability to insert
      the "final" code block with a comment.

      Have added an updated net.sf.sveditor.ui/plugin.xml to this comment. Try
      code completion always. Always_ff template has a leading comment. Then try
      "final", it also has a leading comment.

      Attachment: plugin.xml (53.3 kB; text/xml)

      Status: closed-fixed
      Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
      Last Updated: Thu Jan 02, 2014 02:16 AM UTC
      Owner: nobody

      It would be great to be able to add comments to templates. Take this for
      example:

      /

        • Function: ${function_name} * A description here * Parameters:
          ${variables} TODO: Add variable description *
      • Returns:
      • ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/sveditor/feature-requests/85/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #85

  • StevenAZ
    StevenAZ
    2014-01-02

    I thought I had... I am on 6fdb754...

     
  • Just out of curiosity, what is the content-assist request being made? For example:
    a<<CTRL+SPACE>>

    In this case, the content-assist request is "a" and I would expect to see template proposals on the first page whose content starts with "a" and proposals on the second page whose name starts with "a"

     
  • StevenAZ
    StevenAZ
    2014-01-03

    • status: closed-fixed --> open
     
  • StevenAZ
    StevenAZ
    2014-01-03

    Re-opening pending the conclusion of the discussion above. Once this is done, I want to use it to trigger me to update the default code templates to include comments.

     
    • Can you give me a bit more information on what you're seeing? The updated
      plugin.xml certainly helps. Can you also let me know what you're typing and
      the proposals being returned?

      Thanks,
      Matthew

      On Fri, Jan 3, 2014 at 8:51 AM, StevenAZ stevenaz@users.sf.net wrote:

      Re-opening pending the conclusion of the discussion above. Once this is
      done, I want to use it to trigger me to update the default code templates
      to include comments.


      Status: open
      Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
      Last Updated: Thu Jan 02, 2014 04:59 PM UTC
      Owner: nobody

      It would be great to be able to add comments to templates. Take this for
      example:

      /

        • Function: ${function_name} * A description here * Parameters:
          ${variables} TODO: Add variable description *
      • Returns:
      • ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/sveditor/feature-requests/85/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      Attachments
      • StevenAZ
        StevenAZ
        2014-01-06

        Sorry didn't get back to you ... was out all day. Did you get it?

        On Sun, Jan 5, 2014 at 3:09 PM, Matthew Ballance mballance@users.sf.netwrote:

        Can you give me a bit more information on what you're seeing? The updated
        plugin.xml certainly helps. Can you also let me know what you're typing and
        the proposals being returned?

        Thanks,
        Matthew

        On Fri, Jan 3, 2014 at 8:51 AM, StevenAZ stevenaz@users.sf.net wrote:

        Re-opening pending the conclusion of the discussion above. Once this is
        done, I want to use it to trigger me to update the default code templates
        to include comments.


        Status: open
        Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
        Last Updated: Thu Jan 02, 2014 04:59 PM UTC
        Owner: nobody

        It would be great to be able to add comments to templates. Take this for
        example:

        /

        -
        - Function: ${function_name} * A description here * Parameters:
        ${variables} TODO: Add variable description *
        - Returns:
        - ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/sveditor/feature-requests/85/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/


        Status: open
        Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
        Last Updated: Fri Jan 03, 2014 04:51 PM UTC
        Owner: nobody

        It would be great to be able to add comments to templates. Take this for
        example:

        /

          • Function: ${function_name} * A description here * Parameters:
            ${variables} TODO: Add variable description *
        • Returns:
        • ${return_type} - Add descrption here
          /
          function ${return_type} ${function_name} (${variables});
          ${insert_cursor_here}
          endfunction

        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/sveditor/feature-requests/85/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         
        • StevenAZ
          StevenAZ
          2014-01-06

          1. I type always
          2. Hit Ctrl+Space
          3. always_ff does not come up
          4. Hit Ctrl+Space
          5. always_ff is added to the list of options, selecting it, gives you
            always_ff with comment

          6. Type final

          7. Hit Ctrl+Space
          8. No items come up <<< Expecting final to be instanced.

          On Sun, Jan 5, 2014 at 9:32 PM, Steven Dawson steven.dawson.az@gmail.comwrote:

          Sorry didn't get back to you ... was out all day. Did you get it?

          On Sun, Jan 5, 2014 at 3:09 PM, Matthew Ballance mballance@users.sf.netwrote:

          Can you give me a bit more information on what you're seeing? The updated
          plugin.xml certainly helps. Can you also let me know what you're typing
          and
          the proposals being returned?

          Thanks,
          Matthew

          On Fri, Jan 3, 2014 at 8:51 AM, StevenAZ stevenaz@users.sf.net wrote:

          Re-opening pending the conclusion of the discussion above. Once this is
          done, I want to use it to trigger me to update the default code templates
          to include comments.


          Status: open
          Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
          Last Updated: Thu Jan 02, 2014 04:59 PM UTC
          Owner: nobody

          It would be great to be able to add comments to templates. Take this for
          example:

          /

          -
          - Function: ${function_name} * A description here * Parameters:
          ${variables} TODO: Add variable description *
          - Returns:
          - ${return_type} - Add descrption here
          /
          function ${return_type} ${function_name} (${variables});
          ${insert_cursor_here}
          endfunction


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/sveditor/feature-requests/85/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/


          Status: open
          Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
          Last Updated: Fri Jan 03, 2014 04:51 PM UTC
          Owner: nobody

          It would be great to be able to add comments to templates. Take this for
          example:

          /

            • Function: ${function_name} * A description here * Parameters:
              ${variables} TODO: Add variable description *
          • Returns:
          • ${return_type} - Add descrption here
            /
            function ${return_type} ${function_name} (${variables});
            ${insert_cursor_here}
            endfunction

          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/sveditor/feature-requests/85/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           
  • StevenAZ
    StevenAZ
    2014-01-06

    To replicate:
    1. Type always
    2. Hit Ctrl+Space
    3. always_ff does not come up
    4. Hit Ctrl+Space (a second time)
    5. always_ff is added to the list of options, selecting it, gives you always_ff with comment

    1. Type final
    2. Hit Ctrl+Space
    3. No items come up <<< Expecting final to be instanced.
     
  • StevenAZ
    StevenAZ
    2014-01-07

    Things work when there are other items that automatically come up within a project, but in the case described above, there are no "default" proposals, so nothing comes up.

     
    • Hi Steven,
      Thanks for the additional info, and sorry for not getting back to you
      sooner... I'll do my best to have a look at this in the evening. Hopefully
      the "no default proposals" piece of info will help to reproduce this!

      Best Regards,
      Matthew

      On Tue, Jan 7, 2014 at 7:33 AM, StevenAZ stevenaz@users.sf.net wrote:

      Things work when there are other items that automatically come up within a
      project, but in the case described above, there are no "default" proposals,
      so nothing comes up.


      Status: open
      Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
      Last Updated: Mon Jan 06, 2014 05:06 AM UTC
      Owner: nobody

      It would be great to be able to add comments to templates. Take this for
      example:

      /

        • Function: ${function_name} * A description here * Parameters:
          ${variables} TODO: Add variable description *
      • Returns:
      • ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/sveditor/feature-requests/85/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #85

      • StevenAZ
        StevenAZ
        2014-01-07

        Not a priority at all. Just wanted to capture the info while I was thinking
        about it.
        On Jan 7, 2014 9:08 AM, "Matthew Ballance" mballance@users.sf.net wrote:

        Hi Steven,
        Thanks for the additional info, and sorry for not getting back to you
        sooner... I'll do my best to have a look at this in the evening. Hopefully
        the "no default proposals" piece of info will help to reproduce this!

        Best Regards,
        Matthew

        On Tue, Jan 7, 2014 at 7:33 AM, StevenAZ stevenaz@users.sf.net wrote:

        Things work when there are other items that automatically come up within a
        project, but in the case described above, there are no "default" proposals,
        so nothing comes up.


        Status: open
        Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
        Last Updated: Mon Jan 06, 2014 05:06 AM UTC
        Owner: nobody

        It would be great to be able to add comments to templates. Take this for
        example:

        /

        -
        - Function: ${function_name} * A description here * Parameters:
        ${variables} TODO: Add variable description *
        - Returns:
        - ${return_type} - Add descrption here
        /
        function ${return_type} ${function_name} (${variables});
        ${insert_cursor_here}
        endfunction


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/sveditor/feature-requests/85/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/


        Status: open
        Created: Mon Dec 30, 2013 10:21 PM UTC by StevenAZ
        Last Updated: Tue Jan 07, 2014 03:33 PM UTC
        Owner: nobody

        It would be great to be able to add comments to templates. Take this for
        example:

        /

          • Function: ${function_name} * A description here * Parameters:
            ${variables} TODO: Add variable description *
        • Returns:
        • ${return_type} - Add descrption here
          /
          function ${return_type} ${function_name} (${variables});
          ${insert_cursor_here}
          endfunction

        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/sveditor/feature-requests/85/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Feature Requests: #85

        Attachments
    • status: open --> closed-fixed
     
  • Closing this, since it was implicitly addressed a while back. Now, templates can be inserted based on their ID. This allows comments to be added ahead of the first text