# VS Code IntelliSense Not Working
You're typing code and expecting the familiar dropdown of suggestions, but nothing appears. Or maybe you get suggestions, but they're wrong, outdated, or painfully slow. IntelliSense is the backbone of productive coding, and when it fails, you lose the efficiency gains that make VS Code worthwhile.
Understanding IntelliSense Architecture
IntelliSense in VS Code relies on language servers - separate processes that analyze your code and provide completions. When IntelliSense breaks, it's usually:
- 1.The language server crashed or isn't running
- 2.The language server can't find your project files
- 3.Configuration is blocking or misdirecting IntelliSense
- 4.TypeScript/JavaScript configuration is incomplete
Step 1: Check Language Server Status
Open the Output panel and select your language from the dropdown:
- For TypeScript/JavaScript: "TypeScript"
- For Python: "Python"
- For Go: "Go"
Look for errors like:
``
[error] The TypeScript language server died unexpectedly
[error] Cannot find module './some-module'
[error] Project is not configured correctly
If the language server crashed, restart it:
TypeScript/JavaScript:
Press Ctrl+Shift+P → "TypeScript: Restart TS Server"
Python:
Press Ctrl+Shift+P → "Python: Restart Language Server"
General:
Reload VS Code: Ctrl+Shift+P → "Developer: Reload Window"
Step 2: Verify TypeScript Configuration
For JavaScript and TypeScript projects, a proper tsconfig.json is essential:
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}Common issues:
- Missing
includearray: TypeScript doesn't know which files to analyze - Wrong
rootDir: Paths won't resolve correctly - Missing
typeRootsortypes: Third-party types aren't found
Create tsconfig.json if it doesn't exist:
``bash
npx tsc --init
Step 3: Fix Missing Type Definitions
For JavaScript projects using libraries without built-in types:
# Install type definitions
npm install --save-dev @types/node @types/express @types/reactFor libraries without type definitions:
``bash
# Create a declarations file
touch declarations.d.ts
Add minimal type declarations:
``typescript
// declarations.d.ts
declare module 'untyped-library' {
export function someFunction(input: string): any;
}
Step 4: Check JavaScript Configuration
If you're not using TypeScript but still want IntelliSense in JavaScript:
Create jsconfig.json:
``json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"target": "ES6",
"module": "commonjs",
"checkJs": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
This enables path mapping and better IntelliSense for JS projects.
Step 5: Fix Python IntelliSense Issues
Python IntelliSense requires proper interpreter selection:
- 1.Select interpreter:
- 2.Press
Ctrl+Shift+P - 3."Python: Select Interpreter"
- 4.Choose the correct virtual environment
Install language server components:
``bash
pip install pylance
# or for Jedi
pip install jedi
Check Pylance settings:
``json
{
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true
}
Regenerate Python analysis cache:
``bash
# Delete cached analysis
rm -rf .vscode/settings.json
# Reload window
Step 6: Resolve File Watcher Limits
If IntelliSense is slow or doesn't update when files change, you might be hitting file watcher limits.
Linux: ```bash # Check current limit cat /proc/sys/fs/inotify/max_user_watches
# Increase limit permanently echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf sudo sysctl -p ```
macOS:
File watching usually works, but for large projects:
``json
{
"files.watcherExclude": {
"**/.git/**": true,
"**/node_modules/**": true,
"**/dist/**": true,
"**/build/**": true
}
}
Step 7: Check for Conflicting Extensions
Multiple language extensions can conflict:
code --list-extensionsLook for: - Multiple Python extensions (Python, Pylance, Python Indent, etc.) - Multiple JavaScript/TypeScript extensions - Multiple formatters for the same language
Disable potential conflicts and test:
``bash
code --disable-extension <extension-id>
Step 8: Fix Path Mapping Issues
If you use path aliases (@/components/Button), IntelliSense needs to know about them:
TypeScript (tsconfig.json):
``json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@components/*": ["src/components/*"]
}
}
}
JavaScript (jsconfig.json):
``json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
Webpack aliases must match:
``javascript
// webpack.config.js
module.exports = {
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}
};
Step 9: Clear Caches and Rebuild
Sometimes cached data becomes corrupted:
Delete TypeScript cache:
``bash
rm -rf node_modules/.cache
rm -rf .tsbuildinfo
Reinstall dependencies:
``bash
rm -rf node_modules
npm install
Clear VS Code cached data:
Press Ctrl+Shift+P → "Developer: Clear Cache"
Rebuild IntelliSense index:
Press Ctrl+Shift+P → "TypeScript: Restart TS Server"
Verification
Test IntelliSense is working:
- 1.Type
console.in a JavaScript file - 2.You should see
log,error,warn, etc. - 3.Select one - it should show the function signature
- 4.For Python, type
import osthenos.- you should see path functions
Common Error Patterns
| Symptom | Likely Cause | Solution |
|---|---|---|
| No suggestions at all | Language server not running | Restart language server |
| Wrong suggestions | Incorrect types installed | Reinstall @types packages |
| Slow suggestions | Too many files in include | Exclude node_modules, dist |
| Outdated suggestions | Cached analysis | Delete cache, restart |
| Missing node built-ins | No @types/node | npm i -D @types/node |
| Import paths not resolving | Missing jsconfig/tsconfig | Add path configuration |
IntelliSense problems usually stem from configuration issues. Start with language server status, then verify your TypeScript or JavaScript configuration, and finally check for missing type definitions.