StanAngeloff / php.vim

An up-to-date Vim syntax for PHP (7.x supported)
477 stars 69 forks source link

Cleanup the syntax.ini file ? #80

Closed Taluu closed 5 years ago

Taluu commented 6 years ago

Hello there.

Some things should be cleaned up from the syntax file, such as deprecated / removed extensions (mcrypt, mysql, ...), and maybe updated ?

When launching the script to update the php.vim, I think it would be better to lookup all the enabled extensions and then generate the right syntax from this rather than relying on a syntax.ini file.

Taluu commented 6 years ago

For that, we could rely on the get_loaded_extensions() and get_extension_funcs(), which could also allow us to not depend on reflection (who cares though, as the script shouldn't be often run...)


Edited the links, didn't pay attention to the fact they were the french versions. :}

StanAngeloff commented 6 years ago

Sounds like a good idea. The current syntax update script is intended to be ran by the maintainer (myself). It runs in a Docker container with all extensions installed (granted some obsolete ones are not included). The idea is to have the syntax file include ALL meaningful extensions and let the user decide which ones to include using g:php_syntax_extensions_enabled.

It would be neat to have a command which configures g:php_syntax_extensions_enabled for you auto-magically based on what extensions are reported by get_loaded_extensions().

akrabat commented 6 years ago

In my case, I have extensions loaded inside vagrant & docker that aren't loaded on my local computer, so I quite like having syntax for all all extensions available.