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

No PHP completion #3

Open
justinkruit opened this issue Sep 26, 2024 · 1 comment
Open

No PHP completion #3

justinkruit opened this issue Sep 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@justinkruit
Copy link

Describe the bug
In Latte files it seems to know the php functions (hovering over an existing php functin shows the doc) but it doesn't complete.

Environment (please complete the following information):

  • PhpStorm version 2024.2.1
  • Plugin version 1.3.0

To Reproduce

  1. Install Latte plugin
  2. Edit .latte file

Code

Hi! {get_the_ID()}
{get_the_title()}
{get_field('test_field')}

<div n:class="test_class">
    <p>Test</p>
</div>
{get_

Screenshots
image

@Rixafy Rixafy added the enhancement New feature or request label Sep 28, 2024
@Rixafy
Copy link
Owner

Rixafy commented Sep 28, 2024

Unfortunately, I don't have the time for adding new features right now, even though this seems relatively easy and useful.

The another problem I see is, that when you start typing {<something>, it's not clear if you want to type function, in most cases when programming in Nette world (where Latte is from) and using best practices, you'll want to create a tag like {if}, {block} and so on, and then you'll see a lot of PHP functions that you would never use in latte, instead of actual blocks, I personally used like 1-2 php functions (formatting ipv6) on huge project for web/vps hosting with a lot of templates.

But I get it that it makes a lot of sense in WordPress ecosystem, where are global functions a backbone of the CMS, but I don't know if adding it is worth it, it depends on how many functions with collide with most common macro names.

Maybe take a look at https://plugins.jetbrains.com/plugin/19661-latte-pro, it's more advanced latte plugin that can even recognize the parameters of the functions and it has better php integration overall, I think autocomplete for functions should be included as well, but I'm not sure and it's paid plugin, but I guess it could be worth the saved time.

I'll consider adding this feature when I'll have the time, or I'll review a PR if someone will create one.

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

No branches or pull requests

2 participants