Sometimes when I open a python file (.py extension) in the PyDev Package Explorer, that file is opened as a plain text file - without syntax highlighting, breakpoint setting and all the other great PyDev features. I cannot see any differences to other files in the same folder. When I create another .py file (this time PyDev realises that it is a python source file), add an import unrecognised_file
statement with a breakpoint, debug the file and choose to "Step into" the unrecognised file, it suddenly comes good and I can see syntax highlighting and can use breakpoints and all.
After closing the unrecognised_file and re-opening it, it is back to dumb text mode an I can't use the PyDev features.
Any clues about what is going wrong? What is the algorithm for determining if a file is a python file or a text file?
If this happens (and the association for file marks "Python editor" as the default in the preferences), you can right-click the file and do "open with > other" and choose "Python editor" from the list.
That setting should be persisted for that file later on (what could've happened is that you opened the file as text and Eclipse persists that, so, opening again with the PyDev editor should make the association correct again).
p.s.: the debugger forces opening files with the PyDev editor, but that setting is not persisted as when you open the file through the PyDev Package Explorer (that's why it works when you're in a debug session).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With