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

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

Open jdavidheiser opened this issue 8 years ago • 8 comments

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

jdavidheiser avatar Apr 21 '16 20:04 jdavidheiser

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.

ulidtko avatar May 12 '16 12:05 ulidtko

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

thomir avatar Jul 17 '16 20:07 thomir

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

PostalBlab avatar Aug 06 '16 09:08 PostalBlab

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

erichurkman avatar Aug 15 '16 17:08 erichurkman

@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.

matt-baker avatar Oct 12 '16 18:10 matt-baker

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

agrrh avatar Jan 06 '18 04:01 agrrh

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

ulidtko avatar Jan 10 '18 09:01 ulidtko

+1 +Ping

sunnyakaxd avatar Jul 09 '18 14:07 sunnyakaxd