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 ?
Please sign in to leave a comment.
Please share a screenshot of quick documentation popup shown when you select one of these
.tsxfiles in Project tool window and hitCtrl+Q(or whatever shortcut is assigned to View | Quick documentation action)So, here the file is detected as plain text. I don't know why ?
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 withtsxsuffix) there? Removing this pattern from the list should helpNo tsx in text. I tried to remove in file type TypeScript JSX, '*.tsx' and replaced *.tsx. No changes even with PhpStorm restart.
Strange... Please could you share your
~/Library/Application Support/JetBrains/PhpStorm2020.3/options/filetypes.xmlfile?Yes, here is it (and maybe it's the problem!):
Please check the patterns in Auto-detect file type by content file type - your
Add.tsxmust be thereI 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 !
Deleting the pattern in Preferences | Editor | File types -> Auto-detect file type by content should be enough... But you can remove the
filetypes.xmlfile if you don't need the other mappings. Just make sure to shut down the IDE before doing itYep it's why i've done.
Many thanks !!
turns out tsx files were associated as text. just removed them and it worked