Closed msjyoo closed 8 years ago
I've taken a stab at this on a few occasions, but cannot get anything as reliable as PHPStorm :( Leaving open for others to pitch in.
@StanAngeloff What's wrong with simply detecting if a bracket exists?
Try appending this line after syn match phpMethodsVar
:
syn match phpMethodsVar "\%(->\|::\%($\)\@!\)\s*\h\w*\s*("me=e-1 skipwhite skipempty contained contains=phpMemberSelector,phpFunction display containedin=phpStringDouble
This is the best I've gotten so far. It doesn't work well if the opening bracket (
is on a new line.
Run with your modified syntax/php.vim
for a while and report back if you've hit any edge cases. Hopefully the regexp is precise enough to not affect the rest of highlighting.
To customise function highlighting, override phpFunction
. This is temporary and I reckon we'll add a new highlight group later on.
EDIT: You should append, not prepend the line.
Hello,
I think it would be a good idea to differentiate between class methods and class properties (variables). This is how it works in PHPStorm and it really helps to visually identify.
Maybe the presence of a bracket afterwards could serve as an indicator?