imliam / vscode-inline-parameters

An extension for Visual Studio Code that adds inline parameter annotations when calling a function.
https://marketplace.visualstudio.com/items?itemName=liamhammett.inline-parameters
MIT License
197 stars 21 forks source link

Templating languages #12

Open st-schneider opened 4 years ago

st-schneider commented 4 years ago

Is it possible to extend the support to templating languages that use one of the suppoerted languages? I mean, like using JS in JSX or using twig extensions that are written in php and so on.

imliam commented 4 years ago

JSX should be supported and work - see the supported drivers in the source code. Perhaps JSX needs some different parser configuration to work more reliably...

Other templating languages really depend. Twig is a separate language that is not PHP and I'm not aware of any other Twig support for VSCode that would provide the required information like parameter hints, let alone anything out there that would support generating the AST of a Twig file. Twig extensions are also an odd case, because, due to the nature of them, they are only evaluated in PHP's runtime and not statically available.

st-schneider commented 4 years ago

Ok at least I have something for the parsing part.

https://github.com/trivago/melody/tree/master/packages/melody-parser https://github.com/ambassify/twig-ast https://github.com/twigjs/twig.js (maybe)

st-schneider commented 4 years ago

but could you use the php language server to at least get some information about arguments from the twig extensions?