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

jcelle

  • Community Member
  • Posts: 90
  • Hero Points: 4
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2939
  • Hero Points: 438
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

  • Community Member
  • Posts: 90
  • Hero Points: 4
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

  • Community Member
  • Posts: 90
  • Hero Points: 4
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2939
  • Hero Points: 438
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

  • Community Member
  • Posts: 90
  • Hero Points: 4
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2939
  • Hero Points: 438
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.