Programming & Coding How-TosTechnology

Fix VS Code IntelliSense Not Showing Suggestions in JavaScript

Admin
Fix VS Code IntelliSense Not Showing Suggestions in JavaScript

You open a JavaScript file, start typing, and nothing happens. No method suggestions, no property names, no helpful popup at all. IntelliSense is one of the main reasons people love Visual Studio Code, so when it stops working, coding suddenly feels slow and frustrating.

The good news is that this problem is rarely serious. In most cases, a small setting, a wrong language mode, or a missing piece of setup is blocking the suggestions. This guide walks you through the real causes and the fixes, in the order you should try them.

Quick Answer

VS Code IntelliSense usually stops showing suggestions in JavaScript because the file is not recognised as JavaScript, the language server is stuck, or suggestions have been turned off in settings. Check the language mode in the bottom-right corner, reload the window, and make sure editor.quickSuggestions is enabled. If your project uses libraries, install the matching type definitions so VS Code can understand your code.

What IntelliSense Needs to Work in JavaScript

IntelliSense is the name for the smart suggestions in VS Code. It completes variables, functions, methods, and even shows short documentation as you type. For JavaScript, this power comes from a built-in language service that reads your open files and your project folders.

That service works best when your project looks like a real project. A folder with a package.json file, or at least a jsconfig.json file, tells VS Code where your code lives. Without that structure, suggestions can become weak, slow, or completely missing in larger files.

Check the Language Mode First

The fastest check takes five seconds. Look at the bottom-right corner of the VS Code window. It should say JavaScript for a .js file, or JavaScript React for a .jsx file.

If it says something else, such as Plain Text, suggestions will not appear. Follow these steps:

  1. Click the language name in the bottom-right corner of the status bar.
  2. Type JavaScript in the box that appears at the top.
  3. Select JavaScript from the list.
  4. Start typing again and watch for the suggestion popup.

This often happens with unsaved files. A new file that has never been saved is treated as plain text, so save it with a .js ending first.

Restart the Language Server and Reload the Window

Sometimes everything is set up correctly, but the background service simply gets stuck. This can happen after a big paste, a crash, or a long coding session. Restarting it clears the problem without closing your work completely.

  1. Press Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS to open the Command Palette.
  2. Type Reload Window and select Developer: Reload Window.
  3. Wait a few seconds for VS Code to reopen your folder.
  4. Open your JavaScript file and type a simple line such as console. to test.

If console.log and other methods appear after the dot, the service is alive again. The official guidance in the VS Code IntelliSense documentation also recommends this kind of restart when suggestions behave strangely.

Turn Suggestions Back On in Settings

A changed setting is another very common cause. You may have followed an old tutorial, installed a settings pack, or turned something off by accident. VS Code will respect those choices even when they break your daily workflow.

Open your settings file and look for these values:

  • editor.quickSuggestions should not be set to off for comments, strings, and other text in a way that blocks normal code.
  • editor.suggestOnTriggerCharacters should be true, so typing a dot opens suggestions.
  • editor.wordBasedSuggestions can stay on, but it is not a replacement for real IntelliSense.
  • editor.snippetSuggestions controls snippets only, so it is not the main problem.

How to Check Your Settings Safely

  1. Press Ctrl+, to open Settings.
  2. Search for quick suggestions and confirm the boxes for comments, strings, and other are set the way you want.
  3. Search for suggest on trigger and make sure it is ticked.
  4. If you use a settings.json file, open it from the Command Palette with Preferences: Open User Settings (JSON) and remove any line that disables suggestions.

After changing a setting, you do not always need a full restart. In many cases the popup returns as soon as you type the next character.

Add a jsconfig.json File to Your Project

If suggestions work in small test files but fail in your real project, your project setup is the likely reason. A jsconfig.json file tells the JavaScript language service how to treat your folders.

Create a file named jsconfig.json in the root of your project and add this simple content:

{ "compilerOptions": { "target": "ES2020", "module": "commonjs" }, "exclude": ["node_modules"] }

This does three helpful things. It sets a modern JavaScript version, it explains how modules are handled, and it stops VS Code from scanning the huge node_modules folder. That last point matters a lot, because scanning thousands of library files can make IntelliSense slow or silent.

You can learn more about this setup in the official jsconfig reference for JavaScript projects. It is written for beginners as well as advanced users.

Install Type Definitions for Libraries

JavaScript is a flexible language, and VS Code cannot always guess what a library returns. Type definition files solve this. They describe the shape of a library so VS Code can offer correct methods and warn you about mistakes.

Many popular libraries already include their own definitions. For others, you install a package from the DefinitelyTyped collection. For example, in a project that uses Node.js features, run this command in the terminal:

npm install --save-dev @types/node

After installing, reload the window once. Then test by typing a known object and pressing Ctrl+Space to open suggestions manually. If the list is now rich and accurate, definitions were the missing piece.

Use Manual Triggering to Test

Automatic popups can hide, but manual triggering tells you the truth. Place your cursor after a dot, press Ctrl+Space, and watch what happens.

  • If a full list appears, IntelliSense works and only automatic triggering is off.
  • If only random words from the file appear, the language service is not understanding your code.
  • If nothing appears at all, the service may have crashed or the language mode is wrong.

This simple test saves a lot of guessing. It tells you whether to fix settings or fix the project setup.

Check for Extension Conflicts

Extensions can improve JavaScript coding, but they can also fight with the built-in tools. A formatter, an old linter, or an AI completion tool can sometimes suppress the normal popup.

Try this safe test. Open the Extensions view, disable your JavaScript-related extensions one group at a time, and reload the window after each change. If suggestions return after disabling one extension, you have found the conflict. You can then update it, change its settings, or remove it.

While you are improving your setup, our guide to the best VS Code extensions for beginners can help you choose tools that work well together instead of overlapping.

Other Causes Worth Checking

A few less common causes are easy to miss. Very large files can overwhelm the service, especially generated files or minified code pasted into a normal file. Syntax errors near the top of a file can also confuse suggestions further down, because the parser cannot understand the broken section.

Also check that you opened a folder, not just a single loose file. Use File, then Open Folder, and select your project root. VS Code gives much better IntelliSense when it can see the whole project, its configuration, and its installed packages together.

Common Mistakes to Avoid

  • Testing in an unsaved file: Unsaved files are plain text, so save with a .js name first.
  • Ignoring the language mode: Always glance at the bottom-right corner before trying deeper fixes.
  • Installing random extensions: More extensions do not mean better suggestions, and conflicts are common.
  • Scanning node_modules: Exclude it in jsconfig.json so the service stays fast.
  • Expecting magic without types: Plain JavaScript gives fewer hints than typed code, so add definitions where you can.
  • Changing many settings at once: Change one thing, test, and only then move on.

Conclusion

When IntelliSense stops showing suggestions in JavaScript, start with the simple checks. Confirm the language mode, reload the window, and review your suggestion settings. Then strengthen your project with a jsconfig.json file and the right type definitions. In most cases, one of these steps brings the helpful popup back, and your coding speed returns with it.

Frequently Asked Questions

Why does IntelliSense work in one file but not another?

The broken file may have a wrong language mode, a syntax error near the top, or code that depends on a library without type definitions. Compare the status bar language for both files and fix any errors first.

How do I open suggestions manually in VS Code?

Press Ctrl+Space on Windows or macOS while your cursor is in the code. This forces the suggestion list to open even when automatic popups are turned off or delayed.

Does IntelliSense need an internet connection?

No, the built-in JavaScript service runs on your own computer. You only need the internet to install extensions or download packages and type definitions for your project.

Can a theme or color scheme hide IntelliSense?

A theme changes colors, but it does not normally disable suggestions. If the popup opens but is hard to read, try a different theme to rule out a contrast problem.

Will adding TypeScript fix my JavaScript suggestions?

You do not need to convert your project. Adding a jsconfig.json file and type definitions gives JavaScript files much of the same smart help without changing your language.

Admin

Passionate about the intersection of style and storytelling. I simplify fashion trends and industry news into easy-to-follow advice, helping you stay stylish and informed in the fast-paced world of fashion.

Leave a Reply

Your email address will not be published. Required fields are marked *