language-python icon indicating copy to clipboard operation
language-python copied to clipboard

empty brackets in docstring breaks highlighting

Open fletchapin opened this issue 7 years ago • 5 comments

screen shot 2018-04-18 at 7 00 02 pm screen shot 2018-04-18 at 6 59 53 pm

This wasn't happening in other files, but for this script if a set of brackets are left empty in the docstring it breaks the highlighting for the rest of the file

fletchapin avatar Apr 18 '18 23:04 fletchapin

@fletchapin I'm having some trouble reproducing this - could you please provide a code snippet that reproduces the issue? Thanks!

winstliu avatar Apr 27 '18 18:04 winstliu

I figured out it occurs when I put the raw string tag r in front of the docstring. You can see this in the screenshots below.

screen shot 2018-05-02 at 9 16 53 pm screen shot 2018-05-02 at 9 17 05 pm

fletchapin avatar May 03 '18 01:05 fletchapin

The simplest repro case is this:

r'''[]'''
4

Any code after r'''[]''' is not highlighted like it should, in this case the 4. I'm wondering why brackets in strings are even highlighted.

jscissr avatar May 21 '18 20:05 jscissr

I can repro this in Atom 1.27.0:

Expected:

print()
r"""[ """
print()

Actual: screen shot 2018-05-22 at 1 56 29 pm

MagicPython package handles this correctly: screen shot 2018-05-22 at 1 57 42 pm

alexjurkiewicz avatar May 22 '18 03:05 alexjurkiewicz

I see this too. I only run in to this issue with raw strings -- if you remove the r it seems to work as expected.

adrn avatar Oct 22 '18 19:10 adrn