neild3r / vscode-php-docblocker

Simple docblocker for php
MIT License
94 stars 31 forks source link

how to show the time with php-docblocker.extra #54

Closed plutokaito closed 6 years ago

plutokaito commented 7 years ago

whenever i create the doc or the function, i wanna to show the time, how can i do?

jens1o commented 7 years ago

That's not implemented yet, but not a bad idea.

@neild3r Thoughts? Are you fine with me creating a pr achieving this functionality?

neild3r commented 7 years ago

@jens1o happy for you to create a PR. However I'd recommend we look at some sort variable replacement system that will give us room to expand. Really we are just filling in some deficiencies in the number built in variables you can get from VS code.

jens1o commented 7 years ago

Okay, will do this as soon as I've got time. :)

yuebanliu commented 7 years ago

I can't wait for it

jens1o commented 7 years ago

. However I'd recommend we look at some sort variable replacement system that will give us room to expand.

I'm unsure how I should implement that, that's why I didn't filed a pr, yet. And I forgot to ask @neild3r ... sorry.

neild3r commented 6 years ago

This is probably now possible using the built in date stuff from vscode I will try it and post and example

neild3r commented 6 years ago

Ah this doesn't work right now because the snippet is built programmatically and the varianbles get escaped

neild3r commented 6 years ago

I've created a PR to make it use the built in snippets in the extra setting which will allow you to do this.

kodewithchirag commented 3 years ago

Just wanted to help to other Incase if someone landed on this page while finding a solution for adding a date and time under DocBlock.

I was able to achieve that by below setting,

"php-docblocker.extra": [
        "@createdAt $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND"
    ]

but the only problem with this solution is that the "@createdAt" color was not highlight same as other variables(as in actual it is not a variable and I can understand that ;) ), but the rest worked as expected.

Thanks, @neild3r for adding an extra setting under extension :+1: