Content/Code assist is functionality provided by some
IDEs, which helps the developer to
write code faster and more efficiently. This is achieved by simplifying the task of coding to allow focus on the business task being coded. Based on the context of the code, content assist provides the developer with a list of accessible
keywords according to a
programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
specification,
variable,
methods,
data types
In computer science and computer programming, a data type (or simply type) is a set of possible values and a set of allowed operations on it. A data type tells the compiler or interpreter how the programmer intends to use the data. Most progra ...
, etc.
Autocomplete
Autocomplete
Autocomplete, or word completion, is a feature in which an application predicts the rest of a word a user is typing. In Android and iOS smartphones, this is called predictive text. In graphical user interfaces, users can typically press the tab ...
allows quickly typing names in the context of the code. It can be further improved to assist the developer.
For example, in an XML context, when the developer types an opening tag "<" he is offered a list of tags via autocomplete, contextualized following the
DTD or
XML schema
An XML schema is a description of a type of Extensible Markup Language, XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed ...
of the document. As the developer types more letters, the offered choices are filtered to only retain the relevant completions. When the developer finally completes the tag, the editor automatically generates the closing tag.
Other autocomplete techniques exist. For example, using the
Eclipse
An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
IDE to code in
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
, a developer can just type in the first letter if lowercase and the uppercase letters from a type/variable name then press Ctrl+space to be offered all the choices that match the entered letters that are valid for the current context (class name, interface name, variable or field names).
Code snippet / Code templates
Code snippets allow the developer to add a complex coding structure by typing a minimal amount of text. Code snippets can only be used in a valid context (statements snippets are only offered when you can insert statements).
For example, using the Eclipse IDE to code in Java, a developer can type in "instanceof" then press Ctrl+space which will replace "instanceof" by the following code snippet:
if (obj instanceof MyClass)
This code snippet can be further customised by the developer, with the IDE placing the cursor:
# on the "obj" variable to choose between the available variables at this point,
# on the "MyClass" type to allow the developer to choose the type, after he pressed the tab key,
# on the "myClass" variable to allow the developer to rename the local variable, after he pressed the tab key,
# on line 3 to allow the developer to continue typing the rest of the code, after he pressed the tab key.
See also
*
Autocomplete
Autocomplete, or word completion, is a feature in which an application predicts the rest of a word a user is typing. In Android and iOS smartphones, this is called predictive text. In graphical user interfaces, users can typically press the tab ...
*
Emmet (software)
*
IDE
*
Snippet (programming)
Snippet is a programming term for a small region of re-usable source code, machine code, or text. Ordinarily, these are formally defined operative units to incorporate into larger programming modules. Snippet management is a feature of some text ...
External links
Eclipse Content/Code Assist Documentation
Integrated development environments
{{programming-software-stub