Qt Creator 5.0-Autocomplete
**智能代码补全**是一种编程环境中，有上下文感知的的代码自动完成功能。它可以通过减少打字错误和其他常见错误，使编写应用的速度得到提升。智能代码补全通常在键入、查询函数参数以及与语法错误相关的查询提示时，会弹出自动完成窗口。智能代码补全和相关工具使用反射式编程产生变量名称、函数和方法的文档以及消除歧义。

该功能出现在许多编程环境中。其实现包括Atom中的 "autocomplete +"和Visual Studio Code中的 **IntelliSense**。该术语最初被命名为"选择列表"，一些实现仍然这样称呼它。

概述
--

与其他自动完成系统相似，智能代码补全可以便捷地访问函数的定义，尤其是参数列表。这项功能因为减少键盘输入和不需要记忆名称，加速了软件开发。它同时允许用户更少地查阅外部文档，由于许多在当前范围的符号的交互式文档会以提示框的形式动态显现。
智能代码补全使用内存里的自动生成数据库，其中有类，变量名，和代码中定义或提及的其他概念。典型的智能感知功能的实现，靠的是检测"标记符"，例如句号（或者其他分隔符，由语言决定）。当用户输入有可访问成员（比如成员变量或函数）的实体，紧接输入此类字符时，立刻就弹出一个智能感知建议的弹窗。用户可以通过键入一个完成语句的符号（`Tab ↹`,`↵ Enter`，或者在C++中的分号）接受建议，也可以继续输入。久而久之，智能感知会决定用户最可能需要的变量或函数。智能感知还会凭借函数的源代码中的文档，在弹窗内显示函数的简介。
在支持面向对象编程的语言中，这项功能也让用户从一系列重载的函数中选择。一些代码编辑软件以语言服务器的方式提供智能代码补全功能。

已隱藏部分未翻譯内容，歡迎參與翻譯。
History
-------

Research on intelligent code completion began in 1957, with spelling checkers for bitmap images of cursive writing and special applications to find records in databases despite incorrect entries. In 1961, Les Earnest, who headed the research on this budding technology, saw it necessary to include the first spell checker that accessed a list of 10,000 acceptable words. Ralph Gorin, a graduate student under Earnest at the time, created the first true spell-check program written as an application (rather than research) for general English text. SPELL, for the DEC PDP-10 at Stanford University's Artificial Intelligence Laboratory (SAIL), was published in February 1971. Gorin wrote the program in assembly for faster action; he made it by searching a word list for plausible correct spellings that differ by a single letter or adjacent-letter transpositions, and presenting them to the user. Gorin made SPELL publicly accessible, as was done with most SAIL programs, and it soon spread around the world via the then-new ARPANET, about a decade before personal computers came into general use. SPELL and its algorithms and data structures inspired the Unix program Ispell.

Support in editors and IDEs
---------------------------

### Visual Studio

IntelliSense is Microsoft's implementation of code completion, best known in Visual Studio. It was first introduced as a feature of a mainstream Microsoft product in 1996 building on many already invented concepts of code completion and syntax checking, with the Visual Basic 5.0 Control Creation Edition, which was essentially a publicly available prototype for Visual Basic 5.0. Initially, Visual Basic IDE was the primary "test bed" for the technology, but IntelliSense was incorporated into Visual FoxPro and Visual C++ in the Visual Studio 97 timeframe (one revision after first seen in Visual Basic). Because it was based on the introspection capabilities of COM, the Visual Basic versions of IntelliSense were always more robust and complete than the 5.0 and 6.0 (97 and 98 in the Visual Studio naming sequence) versions of Visual C++, which did not have the benefit of being entirely based on COM. These shortcomings (criticized by many VC++ developers since the 97 release) have been largely corrected in the .NET product lines. For example, one of the most requested capabilities missing from the pre-.NET products was support for templates, which is now fully implemented.

IntelliSense has entered a new phase of development with the unified Visual Studio.NET environment first released in 2001, augmented by the more powerful introspection and code documentation capabilities provided by the .NET framework. IntelliSense is now supported by the Visual Studio editors for C++, C#, J#, Visual Basic, XML, HTML and XSLT among others. As of Visual Studio 2005, IntelliSense is now activated by default when the user begins to type, instead of requiring marker characters (though this behavior can be turned off). The IDE has the capability of inferring a greater amount of context based on what the developer is typing, to the point that basic language constructs such as for and while are also included in the choice list. In 2017 Microsoft announced IntelliCode, which uses machine learning to infer exactly which language or library feature is likely to be intended at every keystroke. Initially available as an extension for C# only, it is expected to be built in to future releases of Visual Studio.

Visual Studio 2022 includes artificial-intelligence features that can automatically suggest entire lines of code based on surrounding context.

Other Microsoft products that incorporate IntelliSense include Expression Web, FrontPage 2003, Small Basic, the Visual Basic for Applications IDEs in the Microsoft Office products, Visual Studio Code and many others. SQL Server 2008 Management Studio has autocomplete for the SQL syntax.

### Eclipse

The Eclipse IDE has code completion tools that come packaged with the program. It includes notable support for Java, C++, and JavaScript code authoring.
The Code Recommenders Eclipse project used to provide powerful intelligent completion, but due to lack of resources, was dropped in Eclipse 2018–12, and then archived in July 2019.

### Vim

Vim Intellisense is an advanced code completion system for the Vim editor.

Example
-------

Assume a C++ application being edited in Visual Studio has a class Foo with some member functions:

```
class Foo {
 public:
 void bar();
 void foo\_bar(char c, int n);
};

```

When the developer references this class in source code, e.g.:

```
Foo foo;
foo.

```

as soon as the user types the period after *`foo`*, IntelliSense automatically lists all the available member functions (i.e. `bar()` and `foo_bar()`) and all the available member attributes (private and protected members can be identified by a padlock picture beside their names). The user can then select one by using the arrow keys and hitting a completion character when the correct member function is highlighted. When available, IntelliSense displays a short description of the member function as given in the source code documentation.

IntelliSense goes further by indicating the required parameters in another pop-up window as the user fills in the parameters. As the user types a variable name, the feature also makes suggestions to complete the variable as they are typed. IntelliSense continues to show parameters, highlighting the pertinent one, as the user types.

The user can "force" IntelliSense to show its pop-up list without context by using `Ctrl`+`J` or `Ctrl`+`Space`. In Visual Studio this displays the entire application domain object model available to the developer.

参考来源
----

1. ↑  Bruch, Marcel; Monperrus, Martin; Mezini, Mira..  (PDF). 2009: 213  [2022-12-13]. ISBN 9781605580012. S2CID 18621745. doi:10.1145/1595696.1595728. （原始内容存档 (PDF)于2022-12-13）.
2. ↑ . www.dictionary.com.  [2022-12-13]. （原始内容存档于2023-03-06） （英语）.
3. ↑ . wiki.codeblocks.org.  [2022-12-13]. （原始内容存档于2020-09-18）.
4. ↑  Qt Documentation - Completing Code （页面存档备份，存于）. Retrieved on 2015-07-07.
5. ↑  Salesforce.. developer.salesforce.com. 2008-12-09  [2022-12-13]. （原始内容存档于2022-12-13） （美国英语）.
6. ↑  Murach. . : 56.
7. ↑  Earnest, Les.  (PDF). Stanford University.  [2011-10-10]. （原始内容 (PDF)存档于2012-10-22）.
8. ↑  Peterson, James.  (PDF). December 1980  [2011-02-18]. （原始内容存档 (PDF)于2018-06-25）.
9. ↑  Earnest, Les.  (PDF).  [2011-02-18]. （原始内容 (PDF)存档于2011-07-20）.
10. ↑  Using IntelliSense （页面存档备份，存于）. Msdn.microsoft.com. Retrieved on 2014-04-04.
11. ↑ .  [2022-12-13]. （原始内容存档于2023-04-08）.
12. ↑ .  [2022-12-13]. （原始内容存档于2023-04-15）.
13. ↑ .  [2022-12-13]. （原始内容存档于2017-07-08）.
14. ↑  Eclipse Code Recommenders: It’s all about intelligent code completion （页面存档备份，存于）. Code-recommenders.blogspot.com (2010-05-03). Retrieved on 2014-04-04.
15. ↑ .  [2022-12-13]. （原始内容存档于2022-12-13）.
16. ↑ .  [2022-12-13]. （原始内容存档于2022-12-13）.
17. ↑ .  [2022-12-13]. （原始内容存档于2023-04-22）.
18. ↑  Vim Intellisense （页面存档备份，存于）. Insenvim.sourceforge.net. Retrieved on 2014-04-04.

外部链接
----

* Torre, Charles.  (Video). Channel9. Microsoft. 2008-01-24  [2022-12-13]. （原始内容存档于2008-06-02）.
*. VS .NET 2003 2015. MSDN.  [2022-12-13]. 原始内容存档于2008-10-12.
*. Visual Prolog.  [2022-12-13]. （原始内容 (Video)存档于2010-08-05）.

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 

| * 
* 论
* 编
集成开发环境 |
| --- |
|  |
| C、C++ | 

|  |  |
| --- | --- |
| 开源软件 | 
* Android Studio
* Anjuta
* Code::Blocks
* CodeLite（英语：）
* Dev-C++
* Eclipse
* Emacs
* Geany
* GNAT Programming Studio
* GNOME Builder
* KDevelop
* Kuzya（英语：）
* MonoDevelop
* NetBeans
* QDevelop
* Qt Creator
* SharpDevelop
* Ultimate++（英语：）
* Vi/Vim
* OpenWatcom

 |
|  |
| 免費軟體 | 
* Pelles C（英语：）
* Philasmicos Entwickler Studio（英语：）
* Sun Studio
* Visual Studio Community
* Xcode

 |
|  |
| 零售软件（英语：） | 
* C++Builder
* 基于Eclipse
	+ CodeWarrior
	+ MyEclipse
* Visual Studio
* JetBrains出品
	+ IntelliJ IDEA
	+ AppCode（英语：）
	+ CLion
* LabWindows/CVI
* LccWin32（英语：）
* IBM Rational Software Architect（英语：）
* Understand（英语：）
* SlickEdit

 |
|  |
| 已终止 | 
* VisualAge（英语：）
* Visual C++ Express
* Borland Turbo C / C++

 |

 |
|  |
| Java | 

|  |  |
| --- | --- |
| 开源软件 | 
* Anjuta
* BlueJ（英语：）
* DrJava（英语：）
* Eclipse
* Geany
* Greenfoot（英语：）
* IntelliJ IDEA Community Edition
	+ Android Studio
* NetBeans
* Servoy Community Edition（英语：）

 |
|  |
| 免費軟體 | 
* jGRASP（英语：）
* JDeveloper

 |
|  |
| 零售软件（英语：） | 
* JBuilder
* JCreator
* MyEclipse
* IBM
	+ WebSphere Integration Developer（英语：）
* JetBrains IntelliJ IDEA
* Servoy Business Application Platform Edition（英语：）
* SlickEdit
* Understand（英语：）
	+ Rational Application Developer（英语：）

 |
|  |
| 已终止 | 
* Metrowerks CodeWarrior Pro for Java
* JBuilder
* Sun Java Studio Creator（英语：）（已被NetBeans取代）
* Visual Age（英语：）（已被Eclipse取代）
* Visual Cafe（又名Espresso，已被JBuilder取代）
* Visual J++
* NetBeans（变为NetBeans）

 |

 |
|  |
| JavaScript | 

|  |  |
| --- | --- |
| 开源软件 | 
* Vim
* Visual Studio Code
* Atom
* Chromium

 |

 |
|  |
| CLI | 

|  |  |
| --- | --- |
| 开源软件 | 
* MonoDevelop
* SharpDevelop
* Visual Studio Code
* PascalABC.NET（英语：）

 |
|  |
| 免費軟體 | 
* Visual Studio Community

 |
|  |
| 零售软件（英语：） | 
* Visual Studio
* Visual Studio Code
* Rider
* Understand（英语：）
* PascalABC.NET（英语：）

 |
|  |
| 已终止 | 
* Xamarin
* Visual Basic Express
* Visual Web Developer Express
* Visual J# Express
* Visual Studio Express for Windows Phone
* Visual C++ Express
* Visual C# Express
* Express for Desktop
* Express for Web
* Express for Windows

 |

 |
|  |
| Flash | 
* Adobe Flash Builder
* FlashDevelop（英语：）
* Powerflasher FDT（英语：）

 |
|  |
| PHP | 

|  |  |
| --- | --- |
| 开源软件 | 
* Aptana（英语：）
* NetBeans
* Komodo Edit（英语：）
* KDevelop

 |
|  |
| 专有软件 | 
* Codelobster（英语：）
* Komodo IDE（英语：）
* PhpStorm（英语：）
* PHPEdit（英语：）
* SlickEdit
* Zend Studio
* KDevelop

 |

 |
|  |
| R | 
* RStudio
* R Tools for Visual Studio（英语：）

 |
|  |
| Python | 

|  |  |
| --- | --- |
| 开源软件 | 
* Anjuta
* IDLE
* Eric
* IntelliJ IDEA
* Light Table
* Ninja-IDE
* PyDev（英语：）
* PyScripter（英语：）
* PIDA（英语：）
* Spyder
* Komodo Edit（英语：）
* KDevelop
* Vim
* Visual Studio Code
* Thonny（英语：）

 |
|  |
| 专有软件 | 
* Komodo IDE（英语：）
* PyCharm
* PythonAnywhere（英语：）
* SlickEdit
* PyDev（英语：）
* Wing IDE（英语：）
* KDevelop
* Spyder
* PyScripter（英语：）

 |

 |
|  |
| Pascal和Object Pascal | 

|  |  |
| --- | --- |
| 开源软件 | 
* Delphi IDE
* Free Pascal IDE
* Lazarus
* Dev-Pascal
* GNAVI

 |
|  |
| 免費軟體 | 
* Delphi Community

 |
|  |
| 零售软件（英语：） | 
* Delphi

 |
|  |
| 已终止 | 
* Turbo Pascal
* Virtual Pascal（英语：）
* Kylix

 |

 |
|  |
| BASIC | 

|  |  |
| --- | --- |
| 开源软件 | 
* Basic-256（英语：）
* B4X
* MonoDevelop
* SharpDevelop
* Microsoft Small Basic
* SdlBasic（英语：）
* Gambas
* HBasic（英语：）
* Basic For Qt（英语：）
* Basic4GL（英语：）
* QB64（英语：）

 |
|  |
| 免費軟體 | 
* FutureBASIC（英语：）
* RapidQ（英语：）
* thinAir（英语：）
* Visual Studio Community

 |
|  |
| 零售软件（英语：） | 
* Microsoft Visual Studio
* NS Basic（英语：）
* PureBasic
* GLBasic（英语：）
* Liberty BASIC（英语：）
* Xojo

 |
|  |
| 已终止 | 
* CA-Realizer（英语：）
* Jabaco（英语：）
* Phoenix Object Basic（英语：）
* QuickBASIC
* QBasic
* Visual Basic
* Visual Basic Express

 |

 |
|  |
| Go | 

|  |  |
| --- | --- |
| 开源软件 | 
* Vim

 |
|  |
| 免費軟體 | 
* GoLand

 |

 |
|  |
| 线上（英语：） | 
* AWS Cloud9 IDE
* Eclipse Che（英语：）
* SourceLair（英语：）

 |
|  |
| 
* **分类**
* **比较**

 |

 |