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

using ->end() doesn't give RootNode's typehint to the IDE #6

Closed
sawirricardo opened this issue Jun 4, 2022 · 5 comments
Closed

using ->end() doesn't give RootNode's typehint to the IDE #6

sawirricardo opened this issue Jun 4, 2022 · 5 comments

Comments

@sawirricardo
Copy link

since ->end() return the CompoundNode, instead of RootNode, it didn't give access to method like ->string(), ->numeric etc

Maybe we can use something like public function end(): CompoundNode|RootNode so we can have access to that method.

Thoughts?

@bezhermoso
Copy link
Collaborator

Hi @sawirricardo,

This should be taken care of via these @mixin PHPDoc directives on CompoundNode.

What IDE are you using? If you can get it to understand those, you should get them in auto-complete. Here is what it looks like in IntelliJ IDEA or PHPStorm:

Screen Shot 2022-06-14 at 10 23 58 AM

@sawirricardo
Copy link
Author

Using vscode with laravel-ide-helper. maybe due to the ide-helper package? it seems vscode doesnt take the things
image

@bezhermoso
Copy link
Collaborator

I did some quick Googling and found this: neild3r/vscode-php-docblocker#120.

I'm going to close this as I don't believe it's a Hyrule issue. Let me know if that VSCode plugin helps!

@sawirricardo
Copy link
Author

sawirricardo commented Jun 15, 2022

@bezhermoso Oops, Actually, I've installed the docblocker ext too, but it's not working. Is it possible to simply add the return docblock to include RootNode? like this
image
that way the IDE (vscode) works

@bezhermoso
Copy link
Collaborator

Hi @sawirricardo, VSCode auto-complete should work better now: #1

Screen Shot 2022-07-09 at 10 03 27 AM

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

No branches or pull requests

2 participants