Some syntax highlighting not working in .ts/.tsx files in specific project, .js/.jsx works as expected

I'm opening an existing project and not getting some syntax highlighting that I'm expecting. I've checked my file type associations; it looks like the files are recognised as .ts/.tsx correctly, but IDEA just doesn't seem to pick up definitions from other code in the project. I think the project started as non-typescript and ts was added later, so I'm pretty sure some configuration is messed up. When I test a new TS project generated by Vite, the highlighting works as expected.

Image 1: the "useAuth" definition isn't being picked up, and it's not highlighted.

Image 2: Same project, jsx file instead of tsx. Definition is applied

Image 3: New test project, .tsx file. Definition is applied.

The imported useAuth is a .tsx file

IntelliJ IDEA 2021.3.3

0
5 comments

Try invalidating caches: File > Invalidate cache.

0

Unfortunately that didn't work, after re-indexing everything is the same.

0

Please put the cursor inside `useAuth`, hit Shift-Shift and locate "Jump to colors and fonts". Which options are applied in this case?

Also, if you Ctrl-click on `useAuth`, are you navigated to its definition?

0

I cannot navigate by ctrl-click from the .tsx file, I get a "Import Specifier" window (Image 1).

Additionally, Image 2 shows hover popup in the .tsx, Image 3 shows the (working) .jsx.

Finally, image 4 has the "Jump to colors and fonts" window when the cursor in the middle of {useAuth}.

0

What file is useAuth defined in? Is it a Typescript or JavaScript file? What does your tsconfig.json look like?

0

Please sign in to leave a comment.