DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
80 stars 10 forks source link

How to customize PHP DocBlocker ? #157

Closed 377960738 closed 2 years ago

377960738 commented 2 years ago

I want to customize information such as time and author, how to configure? Thanks.

jakubmisek commented 2 years ago

Hi, thanks for the feedback!

There are no configurable PHPDoc snippets yet, but we're planning to add them.

Are you referring to PHPDoc blocks above classes/interfaces, and at file beginnings?

377960738 commented 2 years ago

Are you referring to PHPDoc blocks above classes/interfaces, and at file beginnings?

Yup. And the method.

jakubmisek commented 2 years ago

thanks! we'll add support for customizable PHPDoc snippets

jakubmisek commented 2 years ago

@377960738 there is a pre-release version 1.14.10470 which allows customizing the doc-comments snippets, i.e.:

"php.docblock.classSnippet": {
  "@author": "John",
  "@copyright": "(c) $CURRENT_YEAR",
},
"php.docblock.functionSnippet": {
  "@throws": false,
}

Thank you for the feedback!

tobsn commented 1 year ago

@jakubmisek is $CURRENT_YEAR supposed to be replaced on auto complete? (because it isn't, v1.33.12973)

jakubmisek commented 1 year ago

@tobsn thank you for pointing this out.

It works when typing /**

vsc-complete-phpdoc

And it seems it's not completing the $CURRENT_YEAR when using a Code Action - will be fixed.

tobsn commented 1 year ago

@jakubmisek oh I see, yeah that is part of an sort of unrelated problem. when I type /** copilot tries to auto complete, which means I have to use the action on the sideline :D

jakubmisek commented 1 year ago

@tobsn good point :) we'll try to fix the code action .. in the future update, we'll try to handle /** differently so it would work with copilot hopefully...

jakubmisek commented 1 year ago

@tobsn I've implemented the phpdoc as a snippet for the code action as well. Thank you for reporting that.

The fix will be available in the next pre-release.