Python and language-todo no longer highlighting TODO comments


#1

I’ve just noticed my TODO comments are no longer highlighted when the language is Python. It still seems to work in other languages, such as Java.

I’m running 1.29.0-beta1 on Windows 10 and I have this problem in safe mode as well as normal mode.

Steps to recreate:

Create new file

Change language to Python

type # TODO: something and it should highlight TODO but it doesn’t, the whole line is treated like a normal comment.


#2

Strange. Like this?..
image


#3

What you posted is the appearance I am used to/would expect.

This is what it looks like this for me:
image

I’m not sure if it’s my theme, but it seems like some other highlighting is different between your example and mine.


#4

Hello.

I have tried several combinations and did not find any issues.
image

OS....................Windows Pro (10.0.16299)

Atom (portable).......Atom: V1.29-beta 0
                      Atom: V1.29-beta 1

Theme.................One Dark (my go-to)
                      Atom Dark
                      One Coral Light
                      Wombat Dark

Grammar...............Python built-in (without Tree-Sitter)
                      Python built-in (with Tree-Sitter)
                      MagicPython

WHAT FOLLOWS BELOW WAS NOT SEEN IN ATOM v1.29-BETA ->

But then I went over to my Atom V1.26.1 install. Most of the time it was working but then all of the sudden I was having all sorts of issues! That happened by swapping between grammars.
image

<Grammar Python Traceback seem to work better?!>
image

<Then there is Tree-Sitter on the built-in Python>
image

Most consistently the MagicPython community grammar package seemed to give the best results. The Built-in Pthon grammar sometimes gave problems – but I am not sure why.

Download and install MagicPython; give it a shot.


#5

Tree-sitter (only just now got injection support)


#6

Success. Switching to MagicPython, disabling language-python, and restarting Atom made the highlighting work again.

Hopefully, the native language-python will start working again in a future release.

Thank you


#7

FYI (I know my comment doesn’t make much sense), the builtin language-python works, but you have likely enabled Use Tree Sitter Parsers in Settings -> Core. This switches to the new way of syntax highlighting Atom is rolling out, which the magic-python package doesn’t have support for.

Unfortunately, a side effect is that all the scope names are different, and injections (you see special highlighting for TODO, etc, because it’s injected from the language-todo package) into tree-sitter grammars have not been supported yet.

You can disable the tree-sitter option with no problem. It offers some features that newer packages can take advantage of, but nothing serious right now.


#8

@Aerijo -
Your comments are welcome and it was understood. The trouble is however bigger than the TODO.

There is an inconsistency on the block commentary (""") also. Sometimes it works and other times it does not, when using the core Python grammar. I saw this recently under Atom issues and therefore included it for our test case.

The Tree Sitter method should be very good, but it is not yet matured. The core grammars that utilizes it are still lacking snippets also. As my opinion as a someone who does not even code Python - MagicPython is the best option for the moment.

I do invite you to test the various variations and report your findings.


#9

I did have the experimental tree sitter support enabled. Out of curiosity, I disabled tree sitter parsers, disabled Magic-Python, re-enabled language-python, and closed/re-launched atom. Unfortunately, the TODO: and FIXME: comments were still not highlighted for me.

For now, I am going to leave tree sitter parsers off and use Magic-Python.

Thank you everyone for your assistance.