Pycharm utils.py not getting syntax highlight
Solution 1:
Please see File
| Settings
(Preferences
on Mac) | Editor
| File Types.
Look for your file name mapped to the Text type or to the Auto-detect file type by content type.
Remove the incorrect mapping and it will fix the issue.
If you still can't find the wrong mapping in the IDE settings, locate the options/filetypes.xml
file in the Configuration directory. Close the IDE and either edit this file to remove the incorrect mapping or delete this file to reset all the file types to the defaults.
Solution 2:
As CrazyCoder answered, my file also landed in an unintended association. In my case it was "Auto-detect file type by content". You can just try to add your file to the desired file type (e.g. Python) and PyCharm will automatically try to move the association.