IntelliSense
AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. 🎬 Watch The Story of VS Code! VS Code is now on Instagram, follow @vscode.ig for updates, tips, and more. Rewatch GitHub Copilot Day. IntelliSense View as Markdown Ask in VS Code Ask in VS Code Insiders IntelliSense is a general term for various code editing features including: code completion, parameter info, quick info, and member lists.
IntelliSense features are sometimes called by other names such as "code completion", "content assist", and "code hinting." IntelliSense for your programming language Visual Studio Code IntelliSense is provided for JavaScript, TypeScript, JSON, HTML, CSS, SCSS, and Less out of the box. VS Code supports word-based completions for any programming language but can also be configured to have richer IntelliSense by installing a language extension.
Below are the most popular language extensions in the Visual Studio Marketplace . Select an extension tile below to read the description and reviews to decide which extension is best for you. IntelliSense features VS Code IntelliSense features are powered by a language service. A language service provides intelligent code completions based on language semantics and an analysis of your source code. If a language service knows possible completions, the IntelliSense suggestions will pop up as you type.
If you continue typing characters, the list of members (variables, methods, and more) is filtered to only include members containing your typed characters. Pressing Tab or Enter will insert the selected member. You can trigger IntelliSense in any editor window by typing ⌃Space (Windows, Linux Ctrl+Space ) or by typing a trigger character (such as the dot character ( . ) in JavaScript). Tip The suggestions control supports CamelCase filtering, which means that you can type the letters that are upper cased in a method name to limit the suggestions.
For example, "cra" brings up "createApplication". If you prefer, you can turn off IntelliSense while you type. See Customizing IntelliSense , to learn how to disable or customize VS Code's IntelliSense features. As provided by the language service, you can see quick info for each method by either pressing ⌃Space (Windows, Linux Ctrl+Space ) or selecting the > icon. The accompanying documentation for the method expands to the side.
The expanded documentation remains available and updates as you navigate the list. You can close this by pressing ⌃Space (Windows, Linux Ctrl+Space ) again or by selecting the close icon. After choosing a method, you are provided with parameter info . When applicable, a language service surfaces the underlying types in the quick info and method signatures. In the previous screenshot, you can see several any types. Because JavaScript is dynamic and doesn't need or enforce types, any suggests that the variable can be of any type.
Types of completions The JavaScript code in the following screenshot illustrates IntelliSense completions. IntelliSense gives both inferred proposals and the global identifiers of the project. The inferred symbols are presented first, followed by the global identifiers (indicated by the abc word icon). VS Code IntelliSense offers different types of completions, including language server suggestions, snippets, and simple word-based textual completions.
Icon Name Symbol type Methods and Functions method , function , constructor Variables variable Fields field Type parameters typeParameter Constants constant Classes class Interfaces interface Structures struct Events event Operators operator Modules module Properties and Attributes property Enumerations enum Enumeration members enumMember References reference Keywords keyword Files file Folders folder Colors color Unit unit Snippet prefixes snippet Words text Customizing IntelliSense You can customize your IntelliSense experience in settings and keyboard shortcuts.
Settings The settings shown below are the default settings. You can change these settings in the Settings editor ( ⌘, (Windows, Linux Ctrl+, ) ). { // Controls if quick suggestions should show up while typing "editor.quickSuggestions" : { "other" : true , "comments" : false , "strings" : false }, // Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.
"editor.acceptSuggestionOnCommitCharacter" : true , // Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change "editor.acceptSuggestionOnEnter" : "on" , // Controls the delay in ms after which quick suggestions will show up. "editor.quickSuggestionsDelay" : 10 , // Controls if suggestions should automatically show up when typing trigger characters "editor.suggestOnTriggerCharacters" : true , // Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions "editor.tabCompletion" : "off" , // Controls whether sorting favours words that appear close to the cursor "editor.suggest.localityBonus" : true , // Controls how suggestions are pre-selected when showing the suggest list "editor.suggestSelection" : "first" , // Enable word based suggestions "editor.wordBasedSuggestions" : "matchingDocuments" , // Enable parameter hints "editor.parameterHints.enabled" : true , } Tab completion The editor supports tab completion , which inserts the best matching completion when pressing Tab .
This works regardless of the suggest control showing or not. Also, pressing Tab after inserting a suggestion inserts the next best suggestion. By default, tab completion is disabled. Use the editor.tabCompletion Open in VS Code Open in VS Code Insiders setting to enable it. These values exist: off - (default) Tab completion is disabled. on - Tab completion is enabled for all suggestions and repeated invocations insert the next best suggestion. onlySnippets - Tab completion only inserts static snippets which prefix match the current line prefix.
Locality bonus Sorting of suggestions depends on extension information and on how well they match the current word you are typing. In addition, you can ask the editor to boost suggestions that appear closer to the cursor position, using the editor.suggest.localityBonus Open in VS Code Open in VS Code Insiders setting. In the previous screenshot, you can see that count , context , and colocated are sorted based on the scopes in which they appear (loop, function, file).
Suggestion selection By default, VS Code pre-selects the first suggestion in the suggestion list. If you'd like different behavior, for example, to always select the most recently used item in the suggestion list, you can use the editor.suggestSelection Open in VS Code Open in VS Code Insiders setting. The available editor.suggestSelection Open in VS Code Open in VS Code Insiders values are: first - (default) Always select the top list item. recentlyUsed - The previously used item is selected unless a prefix (type to select) selects a different item. recentlyUsedByPrefix - Select items based on previous prefixes that have completed those suggestions.
Selecting the most recently used item is very useful as you can quickly insert the same completion multiple times. "Type to select" means that the current prefix (roughly the text left of the cursor) is used to filter and sort suggestions. When this happens and when its result differs from the result of recentlyUsed , it will be given precedence. When using the last option, recentlyUsedByPrefix , VS Code remembers which item was selected for a specific prefix (partial text).
For example, if you typed co and then selected console , the next time you typed co , the suggestion console
The rest of this page is on the live site.