atom / language-python

Python package for Atom
Other
191 stars 147 forks source link

broken syntax highlighting with strange combination of SQL code inside of mult-line string #143

Open jdavidheiser opened 8 years ago

jdavidheiser commented 8 years ago

As seen in the below code snippit - the extra assignment lines are interpreted as being part of the triple quote.

Getting rid of the parens or the SELECT statement (so it's not not trying to format as if it were SQL) seems to stop this behavior.

text = """ ('SELECT columns FROM table') """
int = 1
float = 2.0

screen shot

ulidtko commented 8 years ago

Two levels of quoting seem to trigger bad markup as well.

E.g. with single level of quoting: screenshot from 2016-05-12 15-30-04

and with nested quoting: screenshot from 2016-05-12 15-30-27

What's especially vexing with this bug — the rest of the file gets mishighlighted as well, and no simple way around that.

thomir commented 8 years ago

Is there a workaround for this? Personally I'm fine without the syntax highlighting for SQL statements.

PostalBlab commented 8 years ago

@thomir you can disable language-sql. This works for me.

erichurkman commented 8 years ago

This also seems to slow down the entire editor. I have a rather large file full of multi-line strings with embedded quotes in SQL, and editing any line after the first instance of this formatting issue causes is 2-3 seconds per keystroke. Disabling language-sql does work, thanks @PostalBlab

matt-baker commented 8 years ago

@PostalBlab - thanks for the workaround on disabling language-sql. That worked for me as well.

For anyone else looking for where to disable language-sql - it's under Preferences\Packages.

agrrh commented 6 years ago

+1, really annoying bug, especially with 'DELETE' part.

ulidtko commented 6 years ago

Looks like language-python is heading to the trash can; MagicPython to replace it, see atom/atom/#13877.

sunnyakaxd commented 6 years ago

+1 +Ping