VS Code IntelliSense Not Working: How to Fix Autocomplete

Fix VS Code IntelliSense and autocomplete by restarting the language service, checking project scope, language support, settings, and partial mode.

7 min read

If VS Code IntelliSense is not working, reload the language service, manually trigger suggestions, and verify the active language provider. Then check project scope, settings, and partial mode only if the quick test fails.

This article covers language-service IntelliSense, not GitHub Copilot ghost text. Use /vscode/how-to-use-github-copilot-inline-suggestions-in-vs-code for AI inline suggestions.

The current behavior and settings are documented in the official VS Code IntelliSense guide.

Restart VS Code first

The simplest fix that resolves most IntelliSense problems is restarting VS Code. The TypeScript language service that powers IntelliSense for JavaScript and TypeScript can stop working after extended use or after installing packages. Run Developer: Reload Window from the Command Palette for a fast restart. See use IntelliSense and code completion for more details.

If IntelliSense still does not work after a restart, move on to the diagnostic steps below.

Check if you are in partial mode

VS Code's IntelliSense operates in two modes: full project-wide mode and partial mode. In partial mode, many features are disabled or limited.

Hover over the language status indicator in the status bar. It says JavaScript or TypeScript next to the line and column numbers. If the hover tooltip shows Partial mode, VS Code cannot access your full project.

Partial mode happens when:

  • You are using vscode.dev or github.dev in a browser.
  • You opened a file from a virtual file system, such as through the GitHub Repositories extension.
  • The project is still loading and has not finished initialization yet.

In partial mode, you lose cross-file IntelliSense, auto-imports, Go to Definition across files, rename refactoring, and most Quick Fixes. Only word-based suggestions from open files are available. If you are in partial mode and expect full IntelliSense, make sure you have opened a local project folder, not a single file or remote virtual workspace.

Verify your project configuration

JavaScript and TypeScript IntelliSense works for individual files without project configuration. Add or repair a configuration file when VS Code needs an explicit project boundary, compiler options, or exclusions.

For JavaScript projects

For a JavaScript project that needs explicit scope, create jsconfig.json at the source root. This small example excludes generated output and dependencies:

jsonjson
{
  "compilerOptions": {
    "module": "CommonJS",
    "target": "ES6"
  },
  "exclude": ["node_modules", "**/node_modules/*", "dist", "build"]
}

The exclude list tells the JavaScript language service which folders are not source code. Paths are relative to the configuration file.

If your project has separate client and server folders, each should have its own configuration file so that server code does not appear in client IntelliSense and vice versa.

For TypeScript projects

Review include, exclude, and project references in tsconfig.json. Generated output should not be part of the same project when it duplicates source files.

Check which project a file belongs to

Open any file and run JavaScript: Go to Project Configuration or TypeScript: Go to Project Configuration from the Command Palette. This opens the configuration file that applies to that file. If a notification says the file is not part of any project, you need to create one.

Check the TypeScript version

VS Code bundles its own version of TypeScript for IntelliSense, but your workspace may use a different version. A mismatch can cause missing features or errors.

Open a JavaScript or TypeScript file and select its language status item, or run TypeScript: Select TypeScript Version from the Command Palette. You can choose between:

  • Use VS Code's Version: The stable bundled version that ships with VS Code. Use this if you do not need a specific TypeScript version.
  • Use Workspace Version: The version installed in your project's node_modules. Use this if your project requires specific TypeScript features.

If IntelliSense stopped working after a TypeScript update in your project, try switching to VS Code's bundled version to see if the problem is version-specific.

Make sure the language extension is enabled

The built-in TypeScript and JavaScript Language Features extension provides IntelliSense. If it was accidentally disabled, IntelliSense stops for JavaScript and TypeScript files.

Open the Extensions view (Ctrl+Shift+X / Cmd+Shift+X). In the ... menu, enable Show Built-in Extensions. Search for TypeScript and JavaScript Language Features. If it shows Disabled, click Enable and reload VS Code.

For other languages like Python, Go, Rust, or C++, make sure the corresponding language extension is installed and enabled. Each language has its own IntelliSense provider.

Fix missing type declarations for JavaScript packages

If IntelliSense works for your own code but not for an npm package like lodash or express, the package is missing TypeScript type declaration files.

VS Code's Automatic Type Acquisition downloads community-maintained type files from DefinitelyTyped automatically. This requires npm to be installed and accessible on your system PATH.

Verify npm is installed by running npm --version in a terminal. If npm is installed but automatic typing still does not work, set the explicit path in your settings. Search for npm path in the Settings editor and set it to the full path of your npm executable. On Windows, include the .cmd extension.

You can also explicitly list packages for type acquisition in your project configuration. In your jsconfig.json, add a typeAcquisition section with the packages you need:

jsonjson
{
  "typeAcquisition": {
    "include": ["lodash", "express"]
  }
}

After adding this, run Developer: Reload Window to trigger type acquisition.

Check your IntelliSense settings

A few settings can make IntelliSense appear broken when it is actually just configured differently than expected.

Open your Settings and check these values:

SettingDefaultWhat to check
Quick SuggestionsOn for most, off for strings/commentsIf set to off everywhere, suggestions never appear automatically.
Suggest on Trigger CharactersOnIf off, suggestions only appear on manual trigger.
Quick Suggestions Delay10 msIf set very high, suggestions take too long to appear.
Word Based SuggestionsmatchingDocumentsIf off, word-based fallback suggestions are disabled.
Snippet SuggestionsinlineIf none, snippets are hidden from the suggestion list.

You can manually trigger suggestions with Ctrl+Space on Windows, Linux, and macOS. If the operating system intercepts that shortcut, run Trigger Suggest from the Command Palette or assign another keybinding. If manual triggering works, check the Quick Suggestions setting.

Handle very large workspaces

In very large projects with hundreds of thousands of files, VS Code may partially disable IntelliSense to maintain performance. The fix is to narrow the scope of what the language service processes.

In the project configuration file, use include to specify only the source directories:

jsonjson
{
  "compilerOptions": {
    "module": "CommonJS",
    "target": "ES6"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist", "build"]
}

Also add large directories to your user or workspace settings for general file exclusion. In the Settings editor, search for files exclude and search exclude to hide node_modules, dist, and build directories from the Explorer and search.

Rune AI

Rune AI

Key Insights

  • Restart VS Code first. The language service that powers IntelliSense can stop and a restart fixes it.
  • Hover over the language status indicator to check if you are in partial mode.
  • Verify your jsconfig.json or tsconfig.json excludes large folders like node_modules.
  • Make sure npm is installed and accessible for Automatic Type Acquisition.
  • Check that the built-in TypeScript and JavaScript Language Features extension is not disabled.
RunePowered by Rune AI

Frequently Asked Questions

Why does IntelliSense show Loading for a long time?

The language service may still be loading the project. Check the language status item, reload the window once, and narrow overly broad project include patterns if loading does not finish.

Why do I only get basic word suggestions?

For JavaScript or TypeScript, check whether the language status item says Partial mode. Browser and virtual workspaces can provide only limited cross-file IntelliSense.

How do I fix missing IntelliSense for an npm package?

Confirm the package and its declarations are installed. JavaScript Automatic Type Acquisition also needs npm; use js/ts.tsserver.npm.path only when VS Code reports that it cannot find npm.

Conclusion

Start with the simplest fix: restart VS Code. If that does not work, check the language status indicator for partial mode, verify your jsconfig.json or tsconfig.json configuration, and make sure the TypeScript and JavaScript Language Features extension is enabled. For missing package completions, confirm npm is installed for automatic type acquisition.