Issue with some typescript files

Hi,

I have a problem with some typescript (tsx react) files. Syntax color disappeared, no code completion. Problem is only with few files, not all my project.

However i can edit theses files but damn it's annoying.

I deleted my local repo ant cloned again, but nothing have changed.

I'm running PhpStorm 2020.3.2 and MacOs 10.13.6.

Any idea ?

 

0
11 comments

Please share a screenshot of quick documentation popup shown when you select one of these  .tsx files in Project tool window and hit Ctrl+Q (or whatever shortcut is assigned to View | Quick documentation action)

0
Avatar
Permanently deleted user

So, here the file is detected as plain text. I don't know why ?

0

please check the registered patterns in Settings | Editor | File types -> Text and Auto-detect file type by content file types - can you see <your file name>.tsx (or any other pattern with tsx suffix) there? Removing this pattern from the list should help

0
Avatar
Permanently deleted user

No tsx in text. I tried to remove in file type TypeScript JSX, '*.tsx' and replaced *.tsx. No changes even with PhpStorm restart.

0

Strange... Please could you share your ~/Library/Application Support/JetBrains/PhpStorm2020.3/options/filetypes.xml file?

0
Avatar
Permanently deleted user

Yes, here is it (and maybe it's the problem!):

 

<application>
<component name="FileTypeManager" version="18">
<extensionMap>
<mapping pattern="Add.tsx" type="AUTO_DETECTED" />
<mapping pattern="PriceApiTest" type="PHP" />
</extensionMap>
</component>
</application>%
0

Please check the patterns in Auto-detect file type by content file type - your Add.tsx must be there

0
Avatar
Permanently deleted user

I don't need mapping pattern we can see in the file. Maybe could i delete the file or just mapping pattern ? 

[edit]:

in Auto-detect file type by content i removed "Add.tsx" and it's ok now !

0

Deleting the pattern in Preferences | Editor | File types -> Auto-detect file type by content should be enough... But you can remove the filetypes.xml file if you don't need the other mappings. Just make sure to shut down the IDE before doing it

0
Avatar
Permanently deleted user

Yep it's why i've done.

Many thanks !!

0

turns out tsx files were associated as text. just removed them and it worked

0

Please sign in to leave a comment.