[Github-comments] [geany] Partial Snippets (#811)

philip r brenan notifications at xxxxx
Sun Dec 13 23:35:14 UTC 2015


Please consider extending snippets to provide a partial snippets matching capability as in file matching on the bash command line  This would allow one to use snippets to quickly find and enter method signatures which would resolve an area where Eclipse has a slight advantage in Java programming

For example, one might enter several thousand partial snippet definitions into snippetsconf such as:

    [java]

    paint/set/Subpixel/Text =void/ setSubpixelText(boolean subpixelText)    // Helper for setFlags(), setting or clearing the SUBPIXEL_TEXT_FLAG bit
    paint/set/Text/Align    =void/ setTextAlign(PaintAlign align)          // Set the paint's text alignment
    paint/set/Text/Locale   =void/ setTextLocale(Locale locale)             // Set the text locale
    paint/set/Text/Scale/X  =void/ setTextScaleX(float scaleX)              // Set the paint's horizontal scale factor for text
    paint/set/Text/Size     =void/ setTextSize(float textSize)              // Set the paint's text size

    string/is/Empty         =boolean/ isEmpty()                             // Returns true if the length of this string is 0
    string/last/IndexOf     =int/ lastIndexOf(String string)                // Returns the index of the start of the last match for the given string in this string, or -1
    string/last/IndexOf     =int/ lastIndexOf(int c, int start)             // Returns the last index of the code point c, or -1
    string/last/IndexOf     =int/ lastIndexOf(int c)                        // Returns the last index of the code point c, or -1
    string/last/IndexOf     =int/ lastIndexOf(String subString, int start)  // Returns the index of the start of the previous match for the given string in this string, or -1
    string/length           =int/ length()                                  // Returns the number of chars in this string
    string/matches          =boolean/ matches(String regularExpression)     // Tests whether this string matches the given regularExpression

and then type:


    final int i = astr<tab>


<b>Geany</b> would complete the string and offer a list of:


    is
    last
    length
    matches


to get:


    final int i = a/**string**/last<tab>

<b>Geany</b> would complete the string and offer a list of:


    int lastIndexOf(String string)               // Returns the index of the start of the last match for the given string in this string, or -1
    int lastIndexOf(int c, int start)            // Returns the last index of the code point c, or -1
    int lastIndexOf(int c)                       // Returns the last index of the code point c, or -1
    int lastIndexOf(String subString, int start) // Returns the index of the start of the previous match for the given string in this string, or -1

from which one might choose the third entry to get the following code ready to fill out with the correct parameters:


    final int i = alastIndexOf(int c)                       // Returns the last index of the code point c, or -1

<b>Thanks!</b>


---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/811
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20151213/b73a17a6/attachment.html>


More information about the Github-comments mailing list