bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

Support for one-line comments in array shapes #2819

Closed Korkman closed 6 months ago

Korkman commented 6 months ago

Problem with existing feature Array shapes work (great feature!):

/**
 * @param array{
 *   host:string,
 *   port?:string|int
 * } $config
 */

Array shapes with comments don't:

/**
 * @param array{ // read on for structure
 *   // this is a configuration array
 *   host:string,      // hostname, mandatory
 *   port?:string|int  // port to connect to, defaults to 8080
 * } $config
 */

As standardized by Psalm.

Would be so great to see support for those comments, because right now it's either descriptive or type hinting support for me ...

bmewburn commented 6 months ago

In the interest of keeping the number of issues manageable I'm closing this as I can't see this happening at this stage. It adds a lot of complexity and following docblock conventions there is already a description part of the tag that can be used. The description portion also supports markdown which enables a better experience IMO.

/**
 * @param array{
 *   host:string,
 *   port?:string|int 
 * } $config 
 *   This is a configuration array
 *   * host - hostname, mandatory
 *   * port - port to connect to, defaults to 8080
 */

Screenshot from 2024-03-19 13-55-47