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

Completion for typed variables doesn't work for some classes #36

Open
woldtwerk opened this issue Sep 5, 2024 · 4 comments
Open

Completion for typed variables doesn't work for some classes #36

woldtwerk opened this issue Sep 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@woldtwerk
Copy link

Hi,
I would love to have a feature like this:

phpstorm:
image

vscode:
image

The formatting already works nicely in vcode, but it doesn't allow jumping to the class or autocomplete.

Is this possible in twiggy or would intelephense need to implement it?

@moetelo
Copy link
Owner

moetelo commented Sep 5, 2024

This already should work:

image

Although I've noticed that with some classes this doesn't work as expected and spams errors into the output of Twiggy Language Server.

I'll investigate this further.

@moetelo moetelo added the bug Something isn't working label Sep 5, 2024
@woldtwerk
Copy link
Author

woldtwerk commented Sep 6, 2024

@moetelo do I need symfony/console for that?

[Warn - 2:27:28 PM] Symfony console path "bin/console" does not exist
[Error - 2:27:28 PM] Unexpected end of JSON input

@woldtwerk
Copy link
Author

@moetelo If you need any more info let me know.
I was working in a standard drupal project.

You can setup one quickly with:

composer create-project drupal/recommended-project drupal
cd drupal
composer require drush/drush
drush si standard -y --db-url=sqlite://sites/default/db/.ht.sqlite

@moetelo moetelo changed the title Types in Comments Completion for typed variables doesn't work for some classes Oct 14, 2024
@moetelo
Copy link
Owner

moetelo commented Nov 16, 2024

Hi!

Just realized this is related to #2. Could we start with that one?

The first step is to somehow acquire the "good" \Twig\Environment instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants