Search code examples
reactjstypescriptvisual-studio-code

VSCode Intellisense, snippets, suggestions are not working in JSX, TSX files


Similar to this question: VS Code autocomplete/intellisense not working

March 2023,

I have got this problem with JSX and TSX files when developing with Create-React-App (CRA)

The editor does not show suggestions on Ctrl + Space, no Ctrl + left click to the path, and no tooltips on hover, suggestions when typing hooks or even after finishing the name, no auto-import, etc.

The compiler still show the error but not the editor.


I'm using both stable and insider versions but still no luck. (All are the latest versions)

  • I tried to reload, restart VSCode, and reinstall them as well.
  • I tried to create CRA with both yarn and npm.
  • I tried to disable all extensions and reset the settings to default by deleting the content inside the settings.json file.

Still, the suggestions/intellisense still work on JS and TS files, but not the JSX, TSX for React.

This drives me nuts for days. If u need any further information, pls give me a comment.

Thanks.

VSCode Stable: 1.77.2
VSCode Insiders: 1.78.0
Node: 18.15.0
Typescript: 4.9.5
React: 18.2.0

Lenovo Thinkpad X220
Intel Core i5-2540M
8GB RAM
240GB + 128GB SSD

No suggestions after using Ctrl+Space No suggestions after using Ctrl+Space

Default tsconfig.json after generating app with CRA Default tsconfig.json after generating app with CRA


Solution

  • Finally, I found the answer to a similar question.

    The thing is this TypeScript and JavaScript Language Features built-in extension was disabled, unfortunately.

    If there's anyone facing the same issue with VSCode TS/JS suggestion. Try following the instruction below.

    Ref: https://stackoverflow.com/a/70645642/14112491