phpdoc-parser icon indicating copy to clipboard operation
phpdoc-parser copied to clipboard

Add programming language support.

Open herregroen opened this issue 5 years ago • 5 comments

For the parent trac issue please see: https://meta.trac.wordpress.org/ticket/3063.

In order to add the Gutenberg JSDoc into the code reference we'd want to be able to differentiate between JS and PHP functions, classes etc.

I've written a simple JSDoc template at https://github.com/herregroen/jsdoc-parser that converts JSDoc into a JSON format compatible with this plugin's import.

But importing that could potentially lead to conflicts as PHP and JS functions/classes might have the same names. This PR expands the structure of the plugin to support multiple programming languages. For now it's just a simple direct approach that needs further testing but I wanted to share it as soon as possible in order to gather input.

I've chosen to explicitly add php as well which means that all existing posts would have their name changed as well. Which means migrating would be a concern.

  • Should the plugin automatically move any existing functions / classes / hooks to the PHP language?
  • As the URL of these things will change to include the programming language should the plugin take care of redirects to those?
  • Should other taxonomies be language specific? Is the JS since the same as the PHP since? Especially namespaces are a likely candidate for something that should be language specific.

herregroen avatar Dec 09 '18 20:12 herregroen