atom / atom-dark-syntax

Atom Dark Syntax theme
MIT License
58 stars 97 forks source link

mysql syntax bug in php file #5

Closed Cipa closed 6 years ago

Cipa commented 10 years ago

screen shot 2014-08-13 at 2 36 07 pm

Thanks

benogle commented 10 years ago

This is a dupe, but I cant find the long lines tokenizing issue. @kevinsawicki, help!

benogle commented 10 years ago

Wait, I take that back. It might be a regex issue on the https://github.com/atom/language-php repo. Looks like it's not all hosed.

kevinsawicki commented 10 years ago

I believe is the long line length bug that is being tracked over in https://github.com/atom/atom/issues/1667

benogle commented 10 years ago

I'm not sure it's > 100 tokens, though. Not sure.

kevinsawicki commented 10 years ago

@Cipa Can you provide the text from the screenshot?

kevinsawicki commented 10 years ago

I'll reopen

Cipa commented 10 years ago
$sql = 'SELECT modx_site_content.id,longtitle FROM modx_site_content JOIN modx_site_tmplvar_contentvalues ON contentid = modx_site_content.id WHERE template = 15 AND deleted = 0 AND published = 1 AND hidemenu = 0 AND modx_site_tmplvar_contentvalues.tmplvarid = 40 AND (modx_site_tmplvar_contentvalues.value LIKE "'.$parent.'||%" OR modx_site_tmplvar_contentvalues.value LIKE "%||'.$parent.'||%" OR modx_site_tmplvar_contentvalues.value LIKE "%||'.$parent.'" OR modx_site_tmplvar_contentvalues.value LIKE "'.$parent.'")';

Looks like it's 500+ long

Thanks

kevinsawicki commented 10 years ago

@Cipa and just to confirm, which part isn't the right color?

Cipa commented 10 years ago

One comes to mind I think modx_site_content.id, longtitle should look similar as they are fields in the table. One is prefixed with the table name and the other isn't. At least id and longtitle should be colored the same way.

I'll add more

Cipa commented 10 years ago

Also have a look at this screen shot 2014-08-13 at 3 17 51 pm

This is short line under 100 characters. You can see that modx_site_content.id, longtitle are colored differently. I don't think they should or at least id and longtitle should be the same color and highlighted more than the table name

Cipa commented 10 years ago

Also contentid = modx_site_content.id should be colored differently. See my suggestions above

markie83 commented 7 years ago

comment gray out was not working in PHP after long SQL strings for me so I fixed it by setting PREFFERED LINE LENGTH to 5000 in the PHP GRAMMAR package settings......also had to do this for default softwrap as well

config.cson "*": core: restorePreviousWindowsOnStart: "no" telemetryConsent: "limited" editor: preferredLineLength: 5000 "exception-reporting": userId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" welcome: showOnStartup: false ".html.php.text": editor: preferredLineLength: 5000

EDIT: nevermind with softwrapping enabled OR disabled the PHP grammar still pukes all over itself EDIT2: when placing ?><?php after the first wrapped line (I beleive softwrapping is still hardcoded at some pre-difined amount as it still does this with softwrap globally disabled) then it works after that :/

simurai commented 6 years ago

Not sure if this is still an issue, we can re-open if so.

Currently

<?php
  $sql = 'SELECT modx_site_content.id,longtitle FROM modx_site_content JOIN modx_site_tmplvar_contentvalues ON contentid = modx_site_content.id WHERE template = 15 AND deleted = 0 AND published = 1 AND hidemenu = 0 AND modx_site_tmplvar_contentvalues.tmplvarid = 40 AND (modx_site_tmplvar_contentvalues.value LIKE "'.$parent.'||%" OR modx_site_tmplvar_contentvalues.value LIKE "%||'.$parent.'||%" OR modx_site_tmplvar_contentvalues.value LIKE "%||'.$parent.'" OR modx_site_tmplvar_contentvalues.value LIKE "'.$parent.'")';
?>

renders as:

screen shot 2018-08-24 at 11 45 28 am