#700 Python "print" not shown in autocomplete

closed-later
nobody
Filetypes (68)
5
2012-09-12
2011-05-23
No

"print" is a popular keyword in Python, but Geany's auto-complete instead of suggestting "print", it suggested very weird words such as printErrors, print_arguments...

Discussion

  • Auto-complet of "print"

     
    Attachments
  • Lex Trotman
    Lex Trotman
    2012-09-11

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

    Autocomplete does not offer keywords (see Autocompletion in the Manual), only tags and (optionally) all words in the document are offered.

    This may be a useful feature request but its not a bug.

     
  • Matthew Brush
    Matthew Brush
    2012-09-12

    • summary: Wrong Python auto-complete --> Python "print" not shown in autocomplete
    • status: closed-rejected --> closed-later
     
  • Matthew Brush
    Matthew Brush
    2012-09-12

    Before Python 3 "print" was a statement/keyword and so was not picked up by the script used by Geany to generate the shipped tag file. Since Python 3, "print" is now a function[1] and so should be picked up the tag generation script. However, at this time, I don't think Python 3 is used to generate the shipped tags file, so "print" is not in it yet. I think this "bug" (feature request) will self-correct once Python 3 starts being used to generate the tags (probably within the next few Geany versions). Until then, "print" is considered a keyword and as elextr said, those aren't auto-completed (for better or worse), so either wait for a few more versions or generate/create your own tag file(s).

    [1] http://www.python.org/dev/peps/pep-3105/

     
  • Enrico Tröger
    Enrico Tröger
    2012-09-12

    For the records:

    Some days ago, I added a few hacks to the Python tags generation script. Now it removes
    any tags which start with a Python keyword. This prevents Geany from completing keywords like
    print, pass and so on.

    You can download the list from:
    https://raw.github.com/geany/geany/master/data/python.tags and simply
    replace your installed one.