Lukasa / language-restructuredtext

A ReStructuredText syntax package for Atom
MIT License
27 stars 15 forks source link

Method references in Java Code Blocks break highlighting #28

Closed ghost closed 8 years ago

ghost commented 8 years ago

Everything after a java code block containing a method reference is highlighted as if it were java code.

Example of breaking code block:

.. code-block:: java

    String someString = getOptionalString().orElseThrow(IllegalArgumentException::new);
Lukasa commented 8 years ago

Sorry, @saladoc, to be clear: you're claiming that once you terminate that code-block the highlighting continues? Could you provide a more complete sample?

ghost commented 8 years ago

@Lukasa exactly. Have a screenshot. Screenshot

Formatting on the paragraphs after the code block is back to normal if I remove the method reference.

Lukasa commented 8 years ago

So I think this is a duplicate of #22, so I'll close this to focus there.

I haven't had time to look at this particular issue in a while, so if you're interested in a debugging challenge it'd be interesting to see why the highlighting doesn't stop at the end of the block.

ghost commented 8 years ago

I would gladly if I had the slightest idea about coffeescript and how to debug it. I'll just wait for a solution and keep you updated if I find out more that may be used to pinpoint that bug.

I no longer believe that it is a bug with the language-restructuredtext package, as I just reproduced it with markdown as well. Also the bug only occurs if a constructor reference is used. SomeObject::new will break stuff while SomeObject::anotherMethod will work just fine. I guess I'll have to take this to the atom repo.