Pycharm stopped syntax highlight on __init__.py files Follow
Answered
Today for some reason Pycharm stopped syntax highlighting.
I created a file __init__ in the terminal `touch __init__` and forgot the `.py` extension. From that moment on all the __init__.py files are identified as `plain text` files. Is there some way to revert back or to change the settings so that it can correctly do syntax highlighting on `__init__.py`?
Please sign in to leave a comment.
Please try starting with defaults by renaming/removing configuration folder https://intellij-support.jetbrains.com/hc/en-us/articles/206544519. Does it help?
Hi Sergey,
When you say "Please try starting with defaults by renaming/removing configuration folder". Which folder is that specifically? This is is "/Users/johannesscr/Library/Preferences/PyCharm2018.3".
As additional information: If I create any other file with the extension ".py" the syntax highlighting is correct, it is only the __init__.py that has no syntax highlighting.
Yes, for Mac OS it is
Please rename or remove it and start with defaults. To make sure no custom plugins are causing the problem, do the same for plugins folder (~/Library/Application Support/<PRODUCT><VERSION>).
Same here. Maybe you have already solved, but for those facing this issue:
Preferences>Editor>File Types. In Recognized File Types, choose Text and remove __init__.py from Registered Patterns.
@bertoldo thank you so much. Worked perfectly finally! I had lost auto-complete in every module in every environment of mine because of this thing!