Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions #31

Closed
Olicek opened this issue Nov 20, 2016 · 8 comments
Closed

Suggestions #31

Olicek opened this issue Nov 20, 2016 · 8 comments
Labels

Comments

@Olicek
Copy link

@Olicek Olicek commented Nov 20, 2016

Would be possible make some suggestions? I can imageine something like phpDoc notaion

{** @var \Entity\User $test *}
// comment above would suggest public methods and properties from \Entity\User entity
{$test->}

Is this possible and valid for this plugin?

@JanTvrdik

This comment has been minimized.

Copy link
Collaborator

@JanTvrdik JanTvrdik commented Nov 20, 2016

Yes, feel free to send PR.

@matej21 matej21 added the enhancement label Nov 22, 2016
@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Aug 18, 2018

@JanTvrdik @matej21 I believe this feature is one of most important. If we do some campaign and find some people who are willing to put some money into it (I definitivelly am and believe many more people would also pay for this) would you implement this? Sadly my knowledge of Java and PHPStorm framework is non existant but this is something I would really like to see. It's something that's really missing!

@mesour

This comment has been minimized.

Copy link
Collaborator

@mesour mesour commented Feb 18, 2020

It is possible from 1.0.0

@mesour mesour closed this Feb 18, 2020
@dakur

This comment has been minimized.

Copy link

@dakur dakur commented Feb 20, 2020

@mesour Is there any reason for choosing macro-way ({varType}) over annotation ({** @var *})? Could not find any mention about it. Thanks.

@mesour

This comment has been minimized.

Copy link
Collaborator

@mesour mesour commented Feb 20, 2020

@dakur because comments in Latte starts with {* and ends with *}. It would be unnecessary to refactor comment handling in Latte and also in parser in the plugin. Therefore, a new tag varType has been created.

@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Feb 20, 2020

Plus I believe with latte 2.7 this will be completelly supported and probably with using strict template will also give exception, maybe there's even phpstan extension planned, so this is not just on this plugin level, but on latte level.

@dakur

This comment has been minimized.

Copy link

@dakur dakur commented Feb 21, 2020

@mesour First, I'd like to point out I am really grateful for your effort to implement this feature. Thank you!

Second, my reply: Isn't this misuse of what macros meant to be for just because "it would need more work"? Isn't it similar if someone started to use functions in PHP to type variables (type() int $abcd) just because /**/ would need more work to distinguish comment from annotation? I personally understand macros as kind of functions which do something, whereas typing is just describing stuff, not doing something.

@mesour

This comment has been minimized.

Copy link
Collaborator

@mesour mesour commented Feb 21, 2020

@dakur thanks.

I think it is not the same as in PHP. Because in Latte are used macros (now named as "tags"). And only in these tags you can use PHP. I think of a tag as a placeholder for certain code in PHP and it can also be an @var annotation. I originally wanted {** ... *} but then someone told me it would be better via tag. David did not object to varType when I asked about the implementation of Latte. It also makes sense to me with other tags for types like templateType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.