[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pdt-dev] code assist development

On Thu, Oct 22, 2009 at 8:34 PM, Sjaak Eenhuis <exceptione@xxxxxxxxxxx> wrote:
Currently, pdt doesn't indicate if a certain function parameter is required or optional. As I understand from http://doc.php.net/php/dochowto/chapter-skeletons.php you provide this information allready.

So visually indicating what is required and what not is something which can be accomplished already by the pdt developers.

However, as far as I can see the docbook sources don't contain the actual default value of such an optional parameter. This would come in handy, in cases like

string htmlspecialchars ( string $string [, int $quote_style = ENT_COMPAT [, string $charset [, bool $double_encode = true ]]] )

If I want to use htmlspecialchars with ENT_NOQUOTES I want to see whether I need to override the default of $quote_style.
I've encoutered this type of issues more than once and this info is imho useful enough to have it.

I am curious about your opinions.

On Oct 22, 2009, at 11:41 AM, Michael Spector wrote:
The generated PHP language model does contain an indication about optional parameters in PHPDoc and using parameter initializer (if you open standard.php you'll see it). The problem is that Code Assist doesn't really use this information to present it in a fancy style that you mentioned. We can fix it in the future.

I'm not sure what percentage of PHP documentation with optional parameters utilizes the <initializer> markup, but somewhere between 80-98%. Your suggestion provides the idea that we should check this and ensure proper values (and consistency) throughout the PHP manual, and I'll hack something up to check this soon.

I can't speak of PDT specifics but do want to provide IDE developers with the most information possible, and this includes default values for optional parameters. Maybe one day there will be a universal format for this type information that most/all IDEs will share and use, with the only difference being how it's presented. Dare to dream? :)