#884 auto complete options


I'm writing python code with geany 0.21 on win7.
I've been having constant problems with the auto complete suggestions.
I have attached a screenshot of my interface->completions options.


  • tolomea

    tolomea - 2012-08-23

    interface completions options

  • tolomea

    tolomea - 2012-08-23

    My problem is best explained with an example.
    I have a line that reads:
    card_expiry_month = fields.IntegerFields('card_expiry_month')
    On the next line I type:
    card_expiry_year = fields.Integer
    At that point the only completion option is IntegerArithmenticTestCase which appears to be some unit test thing, until now I'd never seen it before.
    Then I add an F:
    card_expiry_year = fields.IntegerF
    At which point the only completion option is IntegerFields.

    This is typical, generally I find that until I've typed most of the identifier the auto complete list is full of a bunch of stuff I've never seen before and doesn't include the thing I'm trying to type.

    Why was IntegerFields not in there from the start?
    and why is IntegerArithmenticTestCase in there at all?

  • Lex Trotman

    Lex Trotman - 2012-08-23

    Geany comes with a set of tags made from the Python standard library. That includes all the dusty corners of the library.

    Because Python is a dynamically typed language it is not possible to tell the class of the thing you are typing, so all alphabetically compatible completions are offered, no matter how irrelevant. This includes those strange and dusty corners referred to above.

    As for the missing IntegerFields, assuming that it is defined somewhere, with current Geany Git HEAD it always appears alongside IntegerArithmeticTestCase.

    Like you I don't find the standard completions helpful, you can change the name of the python.tags file (in /usr/local/share/geany on Linux, I am not sure where on Windows), I use python.tags.unused. This also fixes the problem of typing pass<return> and having an _ appended to it.

  • Enrico Tröger

    Enrico Tröger - 2012-08-29

    @tomolea: it doesn't solve your problem, but it might be of interest for you, there were added Django tags to the wiki, recently.

    I added a few hacks to the Python tags generation script. Now it removes any tags which start with a Python keyword. This solves Lex' problem with pass_ and return_ which annoyed me as well very much but it took me until now I realised how simple this can be solved.

    Also, now the *TestCase tags are gone.

    @tolomea, I think at least the some of the completion problems are solved by now due to better sorted defaults tags for Python.

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

  • Enrico Tröger

    Enrico Tröger - 2012-08-29
    • assigned_to: nobody --> eht16
    • status: open --> closed-fixed
  • Lex Trotman

    Lex Trotman - 2012-09-12
    • status: closed-fixed --> open
  • Lex Trotman

    Lex Trotman - 2012-09-12
    • status: open --> closed-fixed

Log in to post a comment.