A code completion system suggests future code elements to developers given a partially-complete code snippet. Code completion is one of the most useful features in Integrated Development Environments (IDEs). Currently, most code completion techniques predict a single token at a time. In this paper, we take a further step and discuss the probability of directly completing a whole line of code instead of a single token. We believe suggesting longer code sequences can further improve the efficiency of developers. Recently neural language models have been adopted as a preferred approach for code completion, and we believe these models can still be applied to full-line code completion with a few improvements. We conduct our experiments on two real-world python corpora and evaluate existing neural models based on source code tokens or syntactical actions. The results show that neural language models can achieve acceptable results on our tasks, with significant room for improvements.
翻译:代码完成系统向开发者建议未来的代码元素。 代码完成是综合开发环境( IDES) 中最有用的特征之一。 目前, 大部分代码完成技术都一次预测一个符号。 在本文中, 我们进一步一步讨论直接完成整个代码线而不是单一符号的可能性。 我们认为建议更长的代码序列可以进一步提高开发者的效率。 最近, 神经语言模型已被采纳为完成代码的首选方法, 我们认为这些模型仍然可以用于完成完整代码, 并进行一些改进。 我们实验两个真实世界的 Python 公司, 并评估基于源代码符号或合成动作的现有神经模型。 结果表明, 神经语言模型可以在我们的任务上取得可接受的结果, 并有很大的改进空间 。