Menu

#557 Enable autocompletion everywhere

closed-rejected
nobody
None
5
2014-08-20
2010-09-27
No

I have geany 0.19.1 from the following ubuntu repo:
deb http://ppa.launchpad.net/klaus-vormweg/ppa/ubuntu lucid main
There are several cases where the autocompletion popup does not appear automatically. The ones I found and I would need are:
1) inside comments
2) inside php strings
3) inside perl multiline strings (I mean the $a=<<END format)
4) inside perl strings quoted with qq// but strangely it appears inside ~s///

Discussion

  • Soos Gergely

    Soos Gergely - 2010-09-27

    In my original report above I did not clarify that autocompletion does work in the cases above it just doesn't pop up automatically, I have to use the shortcut key all the time to see the completion list.

     
  • Nick Treleaven

    Nick Treleaven - 2010-09-28

    This is by design to prevent the user having to cancel autocompletion. For scripting languages perhaps autocompletion is still useful when quoting variable names in strings. I don't think comments should be autocompleted though.

     
  • Soos Gergely

    Soos Gergely - 2010-10-04

    Ok I can live without variable autocompletion in comments but in strings I think it's essential.

     
  • Lex Trotman

    Lex Trotman - 2012-09-13
    • status: open --> closed-rejected
     
  • Lex Trotman

    Lex Trotman - 2012-09-13

    The exclusion of strings and comments from autocompletion is because in most languages and most cases those contain natural language not code and automatic completion suggestions are rarely useful. Manual autocompletion is still available.

     
  • asl97

    asl97 - 2014-08-20

    WARNING, before following anything stated in this post, know that i didn't look into the geany source very much, i will not be held liable for any damages that might happen

    for people come here from search engine (like google) who really want to enable auto-complete in comments and string, it is possible do to it but you need to build geany yourself to do it

    all you need to do is download the source then comment out (put // at the start of) the following code in src/editor.c

    if (!force && !highlighting_is_code_style(lexer, style))
               return FALSE;
    

    to

    //if (!force && !highlighting_is_code_style(lexer, style))
    //          return FALSE;
    

    which is line 2193 and 2194 as of 21 august
    https://sourceforge.net/p/geany/git/ci/master/tree/src/editor.c#l2192

    and then build geany with the instruction stated in INSTALL.

     

    Last edit: asl97 2014-08-21
  • Soos Gergely

    Soos Gergely - 2014-08-20

    Yes well unfortunately those line numbers will change in the future. An option (a checkbox) would be nicer than having to recompile geany with every release.
    BTW I found asl97's solution too but I recompile it in debian style (src from repo). I don't think this is the place to describe that so if anyone is interested, they should google "debian recompile package".

    I still think it's a bummer that this request was rejected, because wikipedia lists 12 languages with string interpolation from which at least 4 is supported by geany so at least autocompletion should be enabled to aid interpolated variables. For example in PHP after a $ sign but before the next space.

     

Log in to post a comment.

MongoDB Logo MongoDB