GSoC/GCI Archive
Google Code-in 2013 KDE

KDevelop: Python support: fix parentheses in code completion

completed by: Atanas

mentors: Sven Brauch

Completing a function in Python will append parentheses automatically, which is convenient. There are a few problems in other places though:

- Writing a decorator inserts the parentheses too, but should not (you can recognize this by the name having an @ in front). This should be fixed.

- Writing a class name does not insert the parentheses, but should (usually you want to construct an instance of the class). Take care to put the cursor inside the parentheses when the constructor takes arguments, but behind them when it does not.

- No parentheses should be inserted when the next character is an opening parenthesis already. Chances are good that the user just replaced the function name, leaving the arguments intact.

 

I'm aware that it's not obvious from the task description where to start, but instead of writing a lengthy explanation I'd prefer if you would simply contact me if you're interested in working on this; I'll explain how to get started.