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

Error when 'beautifying' ascx file #230

Open
edpirone opened this issue Mar 9, 2015 · 13 comments
Open

Error when 'beautifying' ascx file #230

edpirone opened this issue Mar 9, 2015 · 13 comments
Assignees
Milestone

Comments

@edpirone
Copy link

edpirone commented Mar 9, 2015

Unsupported language for grammar 'Web Form/Control (C#)'.

Im working off of OS X. Installed uncrustify through brew. Set my paths in Beautify to /usr/local/Cellar/uncrustify/0.61/share/uncrustify/ since it didn't look like it installed in the default location of /usr/local/bin/. Instead a shortcut was placed there that lead to the other path.

Now when I try to beautify I get the error listed above. Use to get Unsupported language for grammar 'Null Grammar'.

Any help would be appreciated.

@Glavin001
Copy link
Owner

Unsupported language for grammar 'Web Form/Control (C#)'.

This means that the grammar Atom has detected for your file is 'Web Form/Control (C#)', which is good, however Atom Beautify does not support that grammar. See https://github.com/Glavin001/atom-beautify/blob/master/lib/language-options.coffee#L406-L499

Unsupported language for grammar 'Null Grammar'.

This means Atom did not detect the grammar of your source code file.


I think what you're trying to beautify is C#? Please confirm.
Atom Beautify does support C# (see https://github.com/Glavin001/atom-beautify/blob/master/lib/language-options.coffee#L465 ). So you could:

  1. change your file's grammar to C# in Atom. See https://github.com/atom/grammar-selector
  2. submit a pull request to Atom Beautify that adds Web Form/Control (C#) along to normal C# at https://github.com/Glavin001/atom-beautify/blob/master/lib/language-options.coffee#L465

Both are simple enough. Option 1 being temporary (you'd have to set the grammar likely when you restart Atom) and option 2 being the best because then Atom Beautify fully supports Web Form/Control (C#) and you and everyone else can use it!

Hope that helps!

@Glavin001 Glavin001 self-assigned this Mar 11, 2015
@Glavin001 Glavin001 added this to the v1.0.0 milestone Mar 11, 2015
@Glavin001
Copy link
Owner

Could you please provide me with some sample code I can write tests for? Thank you.
It can be as simple as a Hello World kind of thing.

@edpirone
Copy link
Author

I wish I could give you something as simple as hello world but I’m just the front-end guy. All this dev was done by another guy at our company. So I am integrating my front-end with his development. Here is the code. Sorry it is a huge chunk of mess. Indents should be somewhat recognizable.

We are using knockout.js in there as well. That is all the commented stuff but I imagine that wouldn’t effect you since it is probably just recognized as a comment.

Code pasted below. 2nd email coming with the actual file.

<%@ control language="C#" autoeventwireup="true" CodeFile="Dashboard.ascx.cs" inherits="Dashboard" %>

Charts Dashboard

    • Chart Filters

    • Chart Views

  • <%--/ko foreach: charts--%>
    <%--/foreach: rows--%>
    <%----%>
    ADD CHART
    <%--/foreach: tabs--%>

    ——

    Ed Pirone
    Director of Digital Media @ SharpHat
    o. 201.503.0020 ext. 205
    c. 551.427.5684
    epirone@sharphat.com

    SharpHat Inc.
    333 Sylvan Ave. Suite 324
    Englewood Cliffs, NJ 07632
    www.sharphat.com

    On Mar 12, 2015, at 12:02 PM, Glavin Wiechert notifications@github.com wrote:

    Could you please provide me with some sample code I can write tests for? Thank you.
    It can be as simple as a Hello World kind of thing.


    Reply to this email directly or view it on GitHub #230 (comment).

    @edpirone
    Copy link
    Author

    ——

    Ed Pirone
    Director of Digital Media @ SharpHat
    o. 201.503.0020 ext. 205
    c. 551.427.5684
    epirone@sharphat.com

    SharpHat Inc.
    333 Sylvan Ave. Suite 324
    Englewood Cliffs, NJ 07632
    www.sharphat.com

    On Mar 12, 2015, at 12:02 PM, Glavin Wiechert notifications@github.com wrote:

    Could you please provide me with some sample code I can write tests for? Thank you.
    It can be as simple as a Hello World kind of thing.


    Reply to this email directly or view it on GitHub #230 (comment).

    @edpirone
    Copy link
    Author

    Sidenote. It is insane how responsive you are to all of this. I’d be happy to donate if you have an option like that. Nothing crazy but I know every dollar helps.

    ——

    Ed Pirone
    Director of Digital Media @ SharpHat
    o. 201.503.0020 ext. 205
    c. 551.427.5684
    epirone@sharphat.com

    SharpHat Inc.
    333 Sylvan Ave. Suite 324
    Englewood Cliffs, NJ 07632
    www.sharphat.com

    On Mar 12, 2015, at 12:02 PM, Glavin Wiechert notifications@github.com wrote:

    Could you please provide me with some sample code I can write tests for? Thank you.
    It can be as simple as a Hello World kind of thing.


    Reply to this email directly or view it on GitHub #230 (comment).

    @Glavin001
    Copy link
    Owner

    That looks sufficiently like HTML, so let's try something:

    • change Atom's grammar: control + shift + L
    • select grammar HTML
    • Beautify this file

    Let me know how that looks.


    Sidenote. It is insane how responsive you are to all of this. I’d be happy to donate if you have an option like that. Nothing crazy but I know every dollar helps.

    Thank you, I appreciate it. I currently do not have any option to donate. Just happy to help my fellow developers 😃.

    @edpirone
    Copy link
    Author

    Apparently you’re a wizard. Thank you. Send the donation link :)

    ——

    Ed Pirone
    Director of Digital Media @ SharpHat
    o. 201.503.0020 ext. 205
    c. 551.427.5684
    epirone@sharphat.com

    SharpHat Inc.
    333 Sylvan Ave. Suite 324
    Englewood Cliffs, NJ 07632
    www.sharphat.com

    On Mar 12, 2015, at 12:17 PM, Glavin Wiechert notifications@github.com wrote:

    That looks sufficiently like HTML, so let's try something:

    change Atom's grammar: control + shift + L
    select grammar HTML
    Beautify this file
    Let me know how that looks.

    Sidenote. It is insane how responsive you are to all of this. I’d be happy to donate if you have an option like that. Nothing crazy but I know every dollar helps.

    Thank you, I appreciate it. I currently do not have any option to donate. Just happy to help my fellow developers .


    Reply to this email directly or view it on GitHub #230 (comment).

    @Glavin001
    Copy link
    Owner

    Apparently you’re a wizard.

    Awesome! Glad it worked out.

    Thank you. Send the donation link :)

    Your thanks is all I need 😃.

    To help others writing ASP.NET Web Form Control code like yourself, I want to officially add support for this fix. Can you confirm that this is the language you installed into Atom? https://github.com/jbalboni/atom-language-aspx
    Supports grammars: Web Form/Control (C#) and Web Handler (C#).

    I am going to add those grammars such that any future user (including yourself) can continue to use those grammars listed above and it will correctly beautify.

    @edpirone
    Copy link
    Author

    Yessir. Thats the one.

    ——

    Ed Pirone
    Director of Digital Media @ SharpHat
    o. 201.503.0020 ext. 205
    c. 551.427.5684
    epirone@sharphat.com

    SharpHat Inc.
    333 Sylvan Ave. Suite 324
    Englewood Cliffs, NJ 07632
    www.sharphat.com

    On Mar 12, 2015, at 12:27 PM, Glavin Wiechert notifications@github.com wrote:

    Apparently you’re a wizard.

    Awesome! Glad it worked out.

    Thank you. Send the donation link :)

    Your thanks is all I need .

    To help others writing ASP.NET Web Form Control code like yourself, I want to officially add support for this fix. Can you confirm that this is the language you installed into Atom? https://github.com/jbalboni/atom-language-aspx https://github.com/jbalboni/atom-language-aspx
    Supports grammars: Web Form/Control (C#) and Web Handler (C#).

    I am going to add those grammars such that any future user (including yourself) can continue to use those grammars listed above and it will correctly beautify.


    Reply to this email directly or view it on GitHub #230 (comment).

    @Glavin001
    Copy link
    Owner

    Published to v0.21.6

    Please give that a shot (revert your selected Atom grammar back to Web Form/Control (C#) and the rest of your files should work and beautify as HTML now out of the box 👍.

    @Glavin001
    Copy link
    Owner

    @edpirone I believe that with the latest version (v0.27.4) this may be broken. This is because I forgot to create a new Language and add the grammar Web Form/Control (C#) to it, such that Atom Beautify detects it as being a supported file.
    While js-beautify still knows to apply beautification to those files, (see

    when "HTML (Liquid)", "HTML", "XML", "Marko", "Web Form/Control (C#)", "Web Handler (C#)"
    ), Atom Beautify will never get to that point without a Language created.

    @edpirone
    Copy link
    Author

    Haven't had any issues with it as of yet.

    @Glavin001
    Copy link
    Owner

    And you are updated to v27.4? Interesting. Well that's great! I'm still going to revisit this just to make sure that I did not break anything with #282. Thanks!

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

    No branches or pull requests

    2 participants