Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code completion
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Autocompletion feature in IDEs}} [[File:Intellisense example in VS2008.png|thumb|Code completion in [[Visual Studio]] 2008]] '''Code completion''' is an [[Autocomplete|autocompletion]] feature in many [[integrated development environment]]s (IDEs) that speeds up the process of coding applications by fixing common mistakes and suggesting lines of code. This usually happens through popups while typing, querying parameters of functions, and query hints related to syntax errors. Modern code completion software typically uses [[generative artificial intelligence]] systems to predict lines of code{{Citation needed|date=May 2025}}. Code completion and related tools serve as documentation and disambiguation for [[variable (programming)|variable]] names, [[Subroutine|function]]s, and [[Method (computer science)|method]]s, using [[Static program analysis|static analysis]].<ref>{{Cite book |title= 2008 23rd IEEE/ACM International Conference on Automated Software Engineering|chapter=How Program History Can Improve Code Completion |date=2008 |doi=10.1109/ASE.2008.42 |last1=Robbes |first1=Romain |last2=Lanza |first2=Michele |pages=317–326 |isbn=978-1-4244-2187-9 |s2cid=2093640 }}</ref><ref>{{Cite web |date=2021-05-28 |title=Code Completion, Episode 1: Scenarios and Requirements |url=https://blog.jetbrains.com/blog/2021/05/28/code-completion-episode-1-scenarios-and-requirements/ |access-date=2023-11-17 |website=The JetBrains Blog |language=en-US}}</ref> The feature appears in many programming environments.<ref>[http://wiki.codeblocks.org/index.php?title=FAQ FAQ - CodeBlocks]. Wiki.codeblocks.org (2014-02-01). Retrieved on 2014-04-04.</ref><ref>[http://doc.qt.io/qtcreator/creator-completing-code.html Qt Documentation - Completing Code]. Retrieved on 2015-07-07.</ref> Implementations include '''IntelliSense'''<!-- Bold per MOS:BOLDSYN --> in [[Visual Studio Code]]. The term was originally popularized as "picklist" and some implementations still refer to it as such.<ref>[http://blogs.developerforce.com/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html Using Dynamic Apex to retrieve Picklist Values | Developer Force Blog]. Blogs.developerforce.com (2008-12-09). Retrieved on 2014-04-04.</ref> ==Overview== Intelligent code completion, which is similar to other [[autocompletion]] systems, is a convenient way to access descriptions of functions—and in particular their parameter lists. The feature speeds up software development by reducing keyboard input and the necessity for name memorization. It also allows for users to refer less frequently to external documentation, as interactive documentation on many symbols (i.e. variables and functions) in the active scope appears dynamically in the form of [[tooltip]]s.<ref>{{cite book|last=Murach|title=C# 2005|page=56}}</ref> Intelligent code completion uses an automatically generated in-memory [[database]] of classes, variable names, and other constructs that given computer code defines or references. The "classic" implementation of IntelliSense works by detecting ''marker characters'' such as periods (or other separator characters, depending on the language). When the user types one of these characters immediately after the name of an entity having one or more accessible members (such as contained variables or functions), IntelliSense suggests matches in a pop-up dialog. The user can either accept the suggestion by typing a statement-completion character ({{keypress|Tab}} or {{keypress|Enter}}) or a language-specific marker (such as the semicolon for [[C++]]), or continue typing the name. Over time, IntelliSense determines which variable or function the user most likely needs. IntelliSense also displays a short description of a function in the pop-up window—depending on the amount of documentation in the function's [[source code]]. The feature also lets users select from a number of [[overloaded function]]s in languages that support [[object-oriented programming]]. Some code editing software provide intelligent code completion through a [[Language Server Protocol]] (LSP) server. ==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.<ref>{{cite web|last=Earnest|first=Les|title=The First Three Spelling Checkers|url=http://www.stanford.edu/~learnest/spelling.pdf|publisher=Stanford University|access-date=10 October 2011|url-status=dead|archive-url=https://web.archive.org/web/20121022091418/http://www.stanford.edu/~learnest/spelling.pdf|archive-date=22 October 2012|df=dmy-all}}</ref> 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.<ref>{{cite book | last1 = Peterson | first1 = James | title = Computer Programs for Detecting and Correcting Spelling Errors | date = December 1980 | url = http://simson.net/ref/2006/csci_e-180/ref/spelling-p676-peterson.pdf | access-date = 2011-02-18}}</ref> Gorin wrote the program in [[assembly language|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.<ref>{{cite book | last1 = Earnest | first1 = Les | title = Visible Legacies for Y3K | url = https://stanford.edu/~learnest/legacies.pdf | access-date = 2011-02-18 | archive-url = https://web.archive.org/web/20110720044806/http://stanford.edu/~learnest/legacies.pdf | archive-date = 20 July 2011 | url-status = dead }}</ref> SPELL and its algorithms and data structures inspired the [[Unix]] program [[Ispell]]. ==Support in editors and IDEs== === {{anchor|IntelliSense|Intellisense}}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<ref>{{Cite web |title=Microsoft KB Archive/165524 - BetaArchive Wiki |url=https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/165524#:~:text=A,Visual%20SourceSafe%20version%20control |access-date=2023-11-19 |website=www.betaarchive.com}}</ref> 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.<ref>{{Cite web |date=1996-10-28 |title=Microsoft Introduces Visual Basic 5.0, Control Creation Edition |url=https://news.microsoft.com/1996/10/28/microsoft-introduces-visual-basic-5-0-control-creation-edition/ |access-date=2023-11-19 |website=Stories |language=en-US}}</ref> Initially, Visual Basic IDE was the primary "test bed" for the technology, but IntelliSense was incorporated into [[Visual FoxPro]] and [[Visual C++]]<ref>{{Cite web |date=1998-06-29 |title=Microsoft Introduces Visual C++ 6.0 |url=https://news.microsoft.com/1998/06/29/microsoft-introduces-visual-c-6-0/ |access-date=2023-11-19 |website=Stories |language=en-US}}</ref> in the Visual Studio 97 timeframe (one revision after first seen in Visual Basic). Because it was based on the introspection capabilities of [[Component Object Model|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 [[Microsoft .NET|.NET]] product lines. For example, one of the most requested capabilities missing from the pre-.NET products was support for [[Generic programming|templates]], which is now fully implemented.<ref>[http://msdn.microsoft.com/en-us/library/hcw1s69b.aspx Using IntelliSense]. Msdn.microsoft.com. Retrieved on 2014-04-04.</ref> 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 Sharp (programming language)|C#]], [[J Sharp|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 [[Integrated development environment|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 {{mono|for}} and {{mono|while}} are also included in the choice list. In 2017 Microsoft announced IntelliCode,<ref>[https://visualstudio.microsoft.com/services/intellicode/ Visual Studio IntelliCode]</ref> 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, such as [[GitHub Copilot]], which can automatically suggest entire lines of code based on surrounding context. Other Microsoft products that incorporate IntelliSense include [[Microsoft Expression Web|Expression Web]], [[Microsoft FrontPage|FrontPage 2003]], [[Microsoft Small Basic|Small Basic]], the [[Visual Basic for Applications]] IDEs in the [[Microsoft Office]] products, [[Visual Studio Code]] and many others. [[SQL Server 2008|SQL Server 2008 Management Studio]] has autocomplete for the SQL syntax. === Eclipse === The [[Eclipse (software)|Eclipse IDE]] has code completion tools that come packaged with the program.<ref>{{Cite web|url=http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html|title = Eclipse Corner Article: Unleashing the Power of Refactoring | the Eclipse Foundation}}</ref><ref>{{Cite web|url=http://www.ibm.com/developerworks/library/os-eclipse-refactoring/|title = Technologies| website=[[IBM]] }}</ref> It includes notable support for Java, C++, and JavaScript code authoring. The Code Recommenders Eclipse project used to provide powerful intelligent completion,<ref>[http://code-recommenders.blogspot.com/2010/05/its-all-about-intelligent-code.html Eclipse Code Recommenders: It’s all about intelligent code completion]. Code-recommenders.blogspot.com (2010-05-03). Retrieved on 2014-04-04.</ref> but due to lack of resources, was dropped in Eclipse 2018–12, and then archived in July 2019.<ref>[https://bugs.eclipse.org/bugs/show_bug.cgi?id=542689 542689 - Don't include Code Recommenders for 2018-12]</ref><ref>[https://www.eclipse.org/lists/cross-project-issues-dev/msg16260.html cross-project-issues-dev Withdrawing Code Recommenders from SimRel]</ref><ref>[https://www.eclipse.org/projects/archives.php Archived Projects | The Eclipse Foundation]</ref> ===Vim=== Vim Intellisense<ref>[http://insenvim.sourceforge.net/ Vim Intellisense]. Insenvim.sourceforge.net. Retrieved on 2014-04-04.</ref> is an advanced code completion system for the [[Vim (text editor)|Vim]] editor. == Example == Assume a C++ application being edited in Visual Studio has a class {{mono|Foo}} with some member functions: <syntaxhighlight lang="cpp"> class Foo { public: void bar(); void foo_bar(char c, int n); }; </syntaxhighlight> When the developer references this class in source code, e.g.: <syntaxhighlight lang="cpp"> Foo foo; foo. </syntaxhighlight> as soon as the user types the period after ''<code>foo</code>'', IntelliSense automatically lists all the available member functions (i.e. <code>bar()</code> and <code>foo_bar()</code>) 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 {{keypress|Ctrl|J}} or {{keypress|Ctrl|Space}}. In [[Visual Studio]] this displays the entire application domain object model available to the developer. ==See also== * {{annotated link|Tabnine}} * [[Microsoft Copilot]] * [[Autocomplete]] * [[Autocorrection]] ==Notes== {{reflist}} {{Integrated development environments}} {{Use dmy dates|date=March 2017}} {{DEFAULTSORT:Integrated development environment}} [[Category:Integrated development environments|*]] [[Category:Text editor features]] [[Category:Microsoft development tools]] [[Category:Microsoft Visual Studio]] [[Category:Autocomplete]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Annotated link
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Integrated development environments
(
edit
)
Template:Keypress
(
edit
)
Template:Mono
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Use dmy dates
(
edit
)