Skip to content

include php blade plugin in php cluster#7618

Draft
haidubogdan wants to merge 43 commits intoapache:masterfrom
haidubogdan:7531_php_blade
Draft

include php blade plugin in php cluster#7618
haidubogdan wants to merge 43 commits intoapache:masterfrom
haidubogdan:7531_php_blade

Conversation

@haidubogdan
Copy link
Contributor

@haidubogdan haidubogdan commented Jul 29, 2024

Laravel is one of the most used frameworks in php, yet it still doesn't have support in Netbeans. (#7531 , #7231).
Mostly the main missing support is for blade templates syntax.

I've started to work on a plugin https://github.com/haidubogdan/netbeans-php-blade-plugin 3 years ago.
After using antlr as a lexer and parser, I found that scaling the plugin was much maintainable.
It's not the cleanest code, but I realized that I will always reach to the 99% finish status if I don't do the first pull request.

TODO

  • Submit an ICLA (sent on 3 august) //I didn't received any response but I can consider it was submited
  • Change to the full name in commits
  • Check the license of the image (no response received from Tailor [laravel], using personal icon)
  • Add unit tests
    • basic lexer tests
    • basic parser error tests
    • basic completion tests
    • basic navigator tests
    • basic embedding tests (html, php)
    • basic braces tests
    • basic typehook tests
    • basic formatting test (wip)
  • Write all features with screenshots

Main features

  • Blade syntax coloring

image

  • Declaration finder for
    • php elements
    • included paths
    • yield ids (section)
    • stack elements
  • Php code completion inside expressions, and echo tags

image

  • Brace matcher and folding

image

  • Find template usage (only in the blade files context)

image

Custom directives

Project -> Properties -> Laravel Blade -> Custom Directives

Just add the php file where you added the custom directive implementation as in https://laravel.com/docs/10.x/blade#extending-blade.

Views folder

If you use blade templates outside of the generic laravel framework or have custom templates folders you can configure them for a project.

This will help the yield and view path completion

Global declaration finder for views paths

Possiblity to go to declaration finder for string parameters inside render, make, view methods.

image
image

Reformat and indentation

Experimental formatting and indenting

blade components

  • Limited completion and declaration finder

    image

  • Config to set paths of the components class implementation for autocomplete & declaration finder.

image

@ebarboni ebarboni requested a review from junichi11 July 29, 2024 08:56
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Jul 30, 2024
@junichi11
Copy link
Member

First of all, thank you for your contribution!

I hope to reach nb 23 deployment

Unfortunately, it's too late. The feature freeze date is July 26th.

Please write all features of this module with screenshots here as well. (not only the link)

Please add unit tests for features. e.g. code completion, indexer, navigator, parser, lexer, formatter etc. (also see: CslTestBase.java)

Did you submit an ICLA?

Probably, it takes a lot of time to review this.

@junichi11 junichi11 requested a review from tmysik July 30, 2024 05:03
@junichi11 junichi11 added this to the NB24 milestone Jul 30, 2024
@haidubogdan
Copy link
Contributor Author

Hi,
thank you for your feedback.
I will prepare the unit tests. ( I hope the base parser unit test classes will be available now that it's included in the IDE folder).
I didn't submit the ICLA. I will read about it.

@junichi11
Copy link
Member

How did you generate icons? (Are there icons based on something?)

https://github.com/apache/netbeans/pull/7618/files#diff-24c53d9c7defe885e1ee8adee9ff009c57d69e75621ad84625d8f9eaa8d7c9e1

…mpletion handler, parse, blade typed text interceptor
…d tokens, rename braces golden file for unix detection
…ude work in progress components editor config
…rm file, move snippet parser outside of antlr package
…est blade functionality with external plugin, cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Don't merge this PR, it is not ready or just demonstration purposes. PHP [ci] enable extra PHP tests (php/php.editor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants