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

Add support for Blade (extension .blade.php) files #32

Open
ghost opened this issue May 8, 2018 · 7 comments
Open

Add support for Blade (extension .blade.php) files #32

ghost opened this issue May 8, 2018 · 7 comments
Assignees

Comments

@ghost
Copy link

ghost commented May 8, 2018

Issue:

formatting does not work in "*.blade.php**" files..

@Glavin001
Copy link
Member

Hi @Rux77 . PHP support was recently added with PHP-CS-Fixer.

Does PHP language work if you change from blade? See https://code.visualstudio.com/docs/languages/overview#_changing-the-language-for-the-selected-file


If PHP does work, then TO-DO to add Blade language support:

@Glavin001 Glavin001 self-assigned this May 8, 2018
@Glavin001
Copy link
Member

@szeck87 we need to think about the process for adding new languages and/or beautifiers. It should NOT be in Unibeautify core or the editor extensions (e.g. VSCode). We need some place which is:

  • central (not Unibeautify core, not editor extension, etc)
  • allow voting (prioritization)

🤔

@stevenzeck
Copy link
Contributor

@Glavin001 To be honest I think they should go in Unibeautify core. Languages have to be implemented there anyways. And we can make use of the issue wizard with templates.

@Glavin001
Copy link
Member

Glavin001 commented May 8, 2018

Sounds good. The multiple templates will be great for this. As long as beautifier-specific requests are routed to the beautifier's correct repository. I don't want Unibeautify core to get as crowded as Atom-Beautify has.

@Glavin001 Glavin001 changed the title Support .blade files!? Add support for Blade (extension .blade.php) files May 8, 2018
@ghost
Copy link
Author

ghost commented May 8, 2018

@Glavin001

Does PHP language work if you change from blade? See

No, it does not format the html elements.The blade files will contain html elements which will not be formatted in this case ( when I set the language to PHP) . but when I set the language to HTML it does trigger the formatting and works great.

Example of blade file (before formatting):

<html>

    <head>
             <title>App Name - @yield('title')</title>
 </head>
      <body>
     @section('sidebar') This is the master sidebar. 
     
     @endsection

        <div class="container">
            @yield('content')
    </div>
</body>
</html>

Example of blade file (after formatting):

<html>

    <head>
        <title>App Name - @yield('title')</title>
    </head>

    <body>
        @section('sidebar') This is the master sidebar. @endsection

        <div class="container">
            @yield('content')
        </div>
    </body>

</html>
  • another issue is some of the blade parts ( in the example above ) did not get formatted as expected, what is expected is something like this:
@section('sidebar') 
This is the master sidebar. 
@endsection

The thing is, I need the blade syntax highlighting which I can only see it in blade language..
Maybe If you can make it easier for the user to be able to do something like this:

    "unibeautify.language": {
        "html": [
            "htm",
            "blade"
        ],
    },

Thanks for your time

@Glavin001
Copy link
Member

Thank you for the details comment! This helps a lot.

Glavin001/atom-beautify#2087 has an interesting solution to formatting Blade code. This is something which could be migrated to Unibeautify.

cc @szeck87

@Glavin001 Glavin001 assigned ghost May 8, 2018
@chipco
Copy link

chipco commented Feb 14, 2019

The thing is, I need the blade syntax highlighting which I can only see it in blade language..
Maybe If you can make it easier for the user to be able to do something like this:

    "unibeautify.language": {
        "html": [
            "htm",
            "blade"
        ],
    },

I could use such a feature to configure HTML+PHP to be formatted with the HTML rules. In my case it's a *.phtml file.

[2019-02-14 18:48:08.205] [exthost] [error] [Glavin001.unibeautify-vscode] provider FAILED
[2019-02-14 18:48:08.205] [exthost] [error] Error: Beautifiers not found for Language: HTML+PHP

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

3 participants