Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Atom 1.32 breaks syntax highlighting #281

Closed
1 task done
hermidalc opened this issue Oct 26, 2018 · 21 comments
Closed
1 task done

Atom 1.32 breaks syntax highlighting #281

hermidalc opened this issue Oct 26, 2018 · 21 comments

Comments

@hermidalc
Copy link

hermidalc commented Oct 26, 2018

Prerequisites

Description

Python syntax highlighting is not working after update to Atom 1.32

Steps to Reproduce

  1. Open any .py file in Atom 1.32

Expected behavior: Proper syntax highlighting

Actual behavior: Parts of code which should be highlighted are now broken and are white

Reproduces how often: 100%

Versions

Atom 1.32

@winstliu
Copy link
Contributor

Thanks for contributing! Can you please share some pictures or other describe in further detail the differences in syntax highlighting that you are experiencing?

@mskornilov
Copy link

It seems like the new Tree-sitter parsing system is causing this weird behaviour.
Turning it off in the settings did the trick for me.
Here's a screenshot with Tree-sitter on:
screenshot from 2018-10-27 15-34-57
And here's with it off:
screenshot from 2018-10-27 15-37-05

@hermidalc
Copy link
Author

Thanks @mskornilov for posting pics of the changed syntax highlighting behavior. Mine looks the same.

@hermidalc
Copy link
Author

Sorry now that I think about it, which syntax highlighting style (1.32 w/ tree-sitter or 1.31.2 without) is the correct one? Maybe it was broken all this time and now is fixed in 1.32?

@mskornilov

This comment has been minimized.

@yousseftarek

This comment has been minimized.

@TheElementalOfDestruction
  • # TODO is nolonger being highlighted in pink/purple. Now it is just grey.
    image

  • Don't know if this one was intentional, but typing '.whatever' makes 'whatever' appear as white, and '.' appear as orange.
    image

  • Triple quotes ( ''' or """ ) do not start highlighting until a close triple quote appears if the first one is not the first character on the line. Instead, they turn everything white after them. They also mess up some of the highlighting before them as well. So if they appear after a space or tab, they do this.
    image

  • Quotes sometimes just completely crap themselves and stop suddenly after non-letter characters if no end-quote is found
    image

@TheElementalOfDestruction

This comment has been minimized.

@hermidalc
Copy link
Author

hermidalc commented Oct 29, 2018

It's definitely the Tree Sitter Parsers that causing the syntax highlighting problem, and in multiple languages. In Atom 1.32 if you go to Settings -> Core -> Tree Sitter Parsers and uncheck it highlighting behavior returns to normal. I'm actually kind of surprised something like this wasn't caught by someone before 1.32 rolled out.

@Ben3eeE

This comment has been minimized.

maxbrunsfeld added a commit that referenced this issue Oct 29, 2018
@maxbrunsfeld
Copy link
Contributor

The highlighting of keyword arguments has been fixed and the fix will ship in Atom 1.32.1.

@asiloisad
Copy link

the language highlithing do not deal correctly with greek letters (python 3 fully support unicode characters), so insted of [a-zA-Z] better can be [a-zA-Zα-ωΑ-Ω]

@maxbrunsfeld
Copy link
Contributor

I'm going to close this out since the original issue has been fixed. @asiloisad I apologize for breaking the highlighting for identifiers with greek letters. That has been fixed (though the fix has not shipped yet).

@TheElementalOfCreation - The TODO issue is tracked at atom/language-todo#82. The issue where we were highlighting an erroneous . as a floating point number 😬 has been fixed on master. I opened a separate issue for the unmatched triple quotes: #285. Thanks for the detailed reports.

Everyone, if there are other issues with python highlighting, please open a new issue that describes the problem specifically. Thank you!

@maxbrunsfeld
Copy link
Contributor

Atom 1.32.2 and 1.33.0-beta2 are out. Sorry for the delay, folks.

@hermidalc
Copy link
Author

hermidalc commented Mar 7, 2019

Hi - am I missing something or is this fix still not available? I have the latest atom with everything updated and when I turn on tree sitter parsers python highlighting still looks wrong.

Tree sitters on:

tree_sitter

Tree sitters off:

no_tree_sitter

@hermidalc
Copy link
Author

Sorry want to ask again for some feedback... since I've been using Atom with Tree Sitter Parsers off for so long I am now unsure what would be the correct way Python should be highlighted :-/

Since I wrote my previous comment March 7, Atom or other updates have improved the Tree Sitters Python syntax highlighting to be more correct now. There still some differences so I'm guessing it was always wrong when Tree Sitters was off (and I just got used to it)?

Tree Sitters ON:
Screenshot from 2019-04-24 08-32-55
OFF:
Screenshot from 2019-04-24 08-33-09

ON:
Screenshot from 2019-04-24 08-50-04
OFF:
Screenshot from 2019-04-24 08-49-56

@winstliu
Copy link
Contributor

winstliu commented Apr 24, 2019

@hermidalc function parameters and subclasses will be highlighted again starting in (I think) Atom 1.37.0 thanks to #297 and #298 from @caleb531.

self not being highlighted is a separate issue that we haven't tackled yet.

Other variables being highlighted was removed in the tree-sitter grammar as there was no way to highlight all variables consistently (and, indeed, you'll notice the inconsistency in your own examples even with tree-sitter turned off).

@caleb531
Copy link
Contributor

@hermidalc Just an update: my improvements to function/class parameter highlighting in #297 and #298 will be actually released in Atom v1.38.0—they are already in beta0, in fact—per the official release notes.

If you want them sooner, you can clone my fork of language-python and rebuild apm by running the following:

git clone https://github.com/caleb531/language-python.git
cd language-python
apm link
apm rebuild

When Atom 1.38.0 is officially released, you can later unlink and rebuild again to use the bundled language-python instead of my fork:

cd language-python
apm unlink
apm rebuild

Then restart Atom to complete the process.

@hermidalc
Copy link
Author

@caleb531 highlighting in 1.38 looking good now. From the above two tree sitters on/off examples I had above the only possible missing hightlight now is in function def if you have e.g. *args or **kwargs the "args" and "kwargs" parts are not orange.

@winstliu
Copy link
Contributor

That was handled in #303 and should be coming down the release pipeline next :).

@Arcanemagus
Copy link

Everyone, if there are other issues with python highlighting, please open a new issue that describes the problem specifically. Thank you!

Please follow these instructions already posted if you run into further issues, thanks!

@atom atom locked as resolved and limited conversation to collaborators Jun 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants