智慧程式碼補全是一種程式設計環境中，有上下文感知的的程式碼自動完成功能。它可以透過減少打字錯誤和其他常見錯誤，使編寫應用的速度得到提升。智慧程式碼補全通常在鍵入、查詢函式引數以及與語法錯誤相關的查詢提示時，會彈出自動完成視窗。智慧程式碼補全和相關工具使用反射式程式設計產生變數名稱、函式和方法的文件以及消除歧義。 該功能出現在許多程式設計環境中。Qt Documentation Completing Code Retrieved on 20150707 其實現包括 Atom 中的 autocomplete 和 Visual Studio Code 中的 IntelliSense。該術語最初被命名為 選擇列表，一些實現仍然這樣稱呼它。 概述 與其他自動完成系統相似，智慧程式碼補全可以便捷地訪問函式的定義，尤其是引數列表。這項功能因為減少鍵盤輸入和不需要記憶名稱，加速了軟體開發。它同時允許使用者更少地查閱外部文件，由於許多在當前範圍的符號的互動式文件會以提示框的形式動態顯現。 智慧程式碼補全使用記憶體裡的自動生成資料庫，其中有類，變數名，和程式碼中定義或提及的其他概念。典型的智慧感知功能的實現，靠的是檢測 標記符，例如句號（或者其他分隔符，由語言決定）。當用戶輸入有可訪問成員（比如成員變數或函式）的實體，緊接輸入此類字元時，立刻就彈出一個智慧感知建議的彈窗。使用者可以透過鍵入一個完成語句的符號（，或者在 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 10000 acceptable words Ralph Gorin a graduate student under Earnest at the time created the first true spellcheck program written as an application rather than research for general English text SPELL for the DEC PDP10 at Stanford Universitys 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 adjacentletter 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 thennew 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 Microsofts 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 50 Control Creation Edition which was essentially a publicly available prototype for Visual Basic 50 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 50 and 60 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 preNET products was support for templates which is now fully implementedUsing IntelliSense Msdnmicrosoftcom Retrieved on 20140404 IntelliSense has entered a new phase of development with the unified Visual StudioNET 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 and 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 artificialintelligence 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 completionEclipse Code Recommenders Its all about intelligent code completion Coderecommendersblogspotcom 20100503 Retrieved on 20140404 but due to lack of resources was dropped in Eclipse 201812 and then archived in July 2019 Vim Vim IntellisenseVim Intellisense Insenvimsourceforgenet Retrieved on 20140404 is an advanced code completion system for the Vim editor Example Assume a C application being edited in Visual Studio has a class 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 eg Foo foo foo as soon as the user types the period after foo IntelliSense automatically lists all the available member functions ie 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 popup 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 popup list without context by using or In Visual Studio this displays the entire application domain object model available to the developer 參考來源 外部連結 CategoryMicrosoft Visual Studio Category 自動補全 Category 整合開發環境 Category 微軟開發工具 Category 文字編輯器功能