Author Topic: Syntax Coloring: Library Symbol found and colored everywhere  (Read 1497 times)

jcelle

  • Senior Community Member
  • Posts: 253
  • Hero Points: 5
Syntax Coloring: Library Symbol found and colored everywhere
« on: January 17, 2020, 07:47:15 AM »
Hello,
I have some extra identification and coloring of Library Symbol in my PHP files.
For instance, 'mail' is a Library Symbol and expressions such as :
function sendamail()
or
$this->checkmail()

get strangely (and wrongly) colored as the 'mail' sub-word is identified as a Library Symbol and colored with the assigned color, which make these expression bi-colored. See attachment.

I can't find out how to solve this.
If anyone has any idea please share !
Many thanks.


Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Syntax Coloring: Library Symbol found and colored everywhere
« Reply #1 on: January 17, 2020, 07:53:25 PM »
Document > PHP Options... > Color Coding...

1) General tab:  It looks like you have modified the identifier characters, it must be missing underscore.

2) Tokens tab:  You can remove the "Library Symbols" that you do not want to be colored everywhere. 
    These are PHP library functions, generally global, but the color coding has no idea about expressions and scoping.

jcelle

  • Senior Community Member
  • Posts: 253
  • Hero Points: 5
Re: Syntax Coloring: Library Symbol found and colored everywhere
« Reply #2 on: January 20, 2020, 06:47:41 AM »
Thanks Dennis,
1) I had thought of this (Identifiers) also but this would not explain the case where color changes in the middle of a word without an underscore.
2) All of the Library Symbols are good and much welcome : it is very good to have these preset by SlickEdit !

This rather looks like a strange bug or broken configuration.
I'm stuck.


jcelle

  • Senior Community Member
  • Posts: 253
  • Hero Points: 5
Re: Syntax Coloring: Library Symbol found and colored everywhere
« Reply #3 on: January 20, 2020, 06:48:59 AM »
Note it only happens after a ->

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Syntax Coloring: Library Symbol found and colored everywhere
« Reply #4 on: January 20, 2020, 03:11:22 PM »
Your identifier start characters are messed up, since it only has '$'.  That's going to make it think that only symbols that start with '$' are identifiers.  Here are my (default) PHP identifier char settings.


jcelle

  • Senior Community Member
  • Posts: 253
  • Hero Points: 5
Re: Syntax Coloring: Library Symbol found and colored everywhere
« Reply #5 on: January 21, 2020, 08:24:19 AM »
Gee ! It works ! I think I don't really understand what is the scope of 'Identifier' : I thought that it would be my variables only (hence starting with $ in php).
Many thanks for pointing out Dennis.
And guess what, it seems to solve my global alias completion problem (you also replied to it).
Many many thanks again.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Syntax Coloring: Library Symbol found and colored everywhere
« Reply #6 on: January 21, 2020, 03:05:05 PM »
Cool.  I love it when I can kill two stones with one bird.