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

Unsupported language for grammar 'ASP.NET Razor' with extension '.cshtml'. #319

Closed
kyle7zhang opened this issue May 5, 2015 · 9 comments

Comments

@kyle7zhang
Copy link

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.196.0
System: Mac OS X 10.10.3
Thrown From: atom-beautify package, v0.26.4

Stack Trace

Unsupported language for grammar 'ASP.NET Razor' with extension '.cshtml'.

At Unsupported language for grammar 'ASP.NET Razor' with extension '.cshtml'.

Error: Unsupported language for grammar 'ASP.NET Razor' with extension '.cshtml'.
    at /Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee:353:29
    at tryCatcher (/Users/Edwin/.atom/packages/atom-beautify/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._resolveFromResolver (/Users/Edwin/.atom/packages/atom-beautify/node_modules/bluebird/js/main/promise.js:427:31)
    at new Promise (/Users/Edwin/.atom/packages/atom-beautify/node_modules/bluebird/js/main/promise.js:53:37)
    at Beautifiers.module.exports.Beautifiers.beautify (/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee:253:14)
    at atom-workspace.beautify (/Users/Edwin/.atom/packages/atom-beautify/src/beautify.coffee:130:18)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:153:19)
    at EventEmitter.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:71:30)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:166:7)

Commands

     -0:00.6.0 beautify:beautify-editor (atom-text-editor.editor.is-focused)

Config

{
  "core": {},
  "atom-beautify": {
    "_analyticsUserId": "9e01c51e-b5d3-463f-a6a6-eb5e02fd781c"
  }
}

Installed Packages

# User
atom-beautify, v0.26.4
autocomplete-css, v0.6.0
emmet, v2.3.8
go-plus, v3.3.10
language-cshtml, v0.1.1

# Dev
No dev packages
@Glavin001
Copy link
Owner

Please run Help Debug Editor command and let me know the results.

@Glavin001 Glavin001 added this to the v0.28.0 milestone May 5, 2015
@Glavin001 Glavin001 self-assigned this May 5, 2015
@kyle7zhang
Copy link
Author

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Thu May 07 2015 16:53:01 GMT+0800 (CST).


Platform: darwin

Versions

Atom Version: 0.196.0

Atom Beautify Version: 0.27.0

Original file to be beautified

Original File Path: /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/City/Add.cshtml

Original File Grammar: ASP.NET Razor

Original File Contents:

@{
    ViewBag.Title = "Add";
}
@section scripts {
<script type="text/javascript" src="../../assets/js/Add.js"></script>
}
@section styles {
<link rel="stylesheet" href="../../assets/css/Add.css"/>
}
<div class="row">
    <div class="form">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">添加城市对应图片:</h3>
            </div>
            <div class="panel-body">
                <form method="post" class="form-horizontal" enctype="multipart/form-data">
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: Red;">* </span>
                                所在省份:
                            </label>
                        </div>
                        <div class="col-md-4">
                            <select class="form-control" id="ddlProvince" width="400px" name ="ProvinceId">
                                <option>====请选择====</option>
                            </select>
                        </div>
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: Red; margin-left: 10px;">* </span>
                                城市:
                            </label>
                        </div>
                        <div class="col-md-4">
                            <select class="form-control" id="ddlCity" width="400px" name="CityId">
                                <option>====请选择====</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <span style="color: red">* </span>
                            <label for="Sort" class="control-label">排序:</label>
                        </div>
                        <div class="col-md-10">
                            @Html.TextBox("Sort", null, new {@class = "form-control"})
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: red">* </span>
                                图片上传(大):
                            </label>
                        </div>
                        <div class="col-md-10">
                            <span class="btn-file">
                                <input class="fileUpload" type="file" data-type="image" name="MaxPhotoUrl" accept="image/*" />
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: red">* </span>
                                图片上传(字):
                            </label>
                        </div>
                        <div class="col-md-10">
                            <span class="btn-file">
                                <input class="fileUpload" type="file" data-type="image" name="MinPhotoUrl" accept="image/*" />
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12 form__footer">
                            <input class="btn btn-primary btn-md" type="submit" id="btnSubmit" value="提交">
                            <a href="/" class="btn btn-default btn-md">返回</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

Beautification options

Editor Options:
Options from Atom Editor settings

{
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false
}

Config Options:
Options from Atom Beautify package settings

{
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "css": {
        "indent_size": 2,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false
    },
    "d": {
        "configPath": ""
    },
    "html": {
        "indent_inner_html": false,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false
    },
    "java": {
        "configPath": ""
    },
    "js": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "php": {
        "fixers": "",
        "level": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 2,
        "ignore": [
            "E24"
        ]
    },
    "sql": {
        "indent_size": 2,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options:
Options from /Users/Edwin/.jsbeautifyrc

{}

EditorConfig Options:
Options from EditorConfig file

{}

Project Options:
Options from .jsbeautifyrc files starting from directory /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/City and going up to root

[
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {}
]

Results

Beautified File Contents:

null

Logs:

2015-05-07T08:53:01.409Z - info: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautify @{
    ViewBag.Title = "Add";
}
@section scripts {
<script type="text/javascript" src="../../assets/js/Add.js"></script>
}
@section styles {
<link rel="stylesheet" href="../../assets/css/Add.css"/>
}
<div class="row">
    <div class="form">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">添加城市对应图片:</h3>
            </div>
            <div class="panel-body">
                <form method="post" class="form-horizontal" enctype="multipart/form-data">
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: Red;">* </span>
                                所在省份:
                            </label>
                        </div>
                        <div class="col-md-4">
                            <select class="form-control" id="ddlProvince" width="400px" name ="ProvinceId">
                                <option>====请选择====</option>
                            </select>
                        </div>
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: Red; margin-left: 10px;">* </span>
                                城市:
                            </label>
                        </div>
                        <div class="col-md-4">
                            <select class="form-control" id="ddlCity" width="400px" name="CityId">
                                <option>====请选择====</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <span style="color: red">* </span>
                            <label for="Sort" class="control-label">排序:</label>
                        </div>
                        <div class="col-md-10">
                            @Html.TextBox("Sort", null, new {@class = "form-control"})
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: red">* </span>
                                图片上传(大):
                            </label>
                        </div>
                        <div class="col-md-10">
                            <span class="btn-file">
                                <input class="fileUpload" type="file" data-type="image" name="MaxPhotoUrl" accept="image/*" />
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="control-label">
                                <span style="color: red">* </span>
                                图片上传(字):
                            </label>
                        </div>
                        <div class="col-md-10">
                            <span class="btn-file">
                                <input class="fileUpload" type="file" data-type="image" name="MinPhotoUrl" accept="image/*" />
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12 form__footer">
                            <input class="btn btn-primary btn-md" type="submit" id="btnSubmit" value="提交">
                            <a href="/" class="btn btn-default btn-md">返回</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
 [ { indent_size: 2, indent_char: ' ', indent_with_tabs: false },
  { cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    css: 
     { indent_size: 2,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false },
    d: { configPath: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false },
    java: { configPath: '' },
    js: 
     { indent_size: 2,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       space_after_anon_function: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    php: { fixers: '', level: '' },
    python: { max_line_length: 79, indent_size: 2, ignore: [Object] },
    sql: { indent_size: 2, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  {},
  {},
  {},
  {},
  {},
  {},
  {},
  {},
  {},
  {} ] ASP.NET Razor /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/City/Add.cshtml

@zachfitz
Copy link

+1

@Glavin001
Copy link
Owner

Thanks @icese7en. Atom Beautify may already be able to handle this language. Also see #230 for C# ASP.NET Web Forms.
For reference (for me mostly), Razor Markup Syntax: http://www.w3schools.com/aspnet/razor_intro.asp

Could you trick Atom Beautify into treating this file as one of the existing languages: Atom -> Menu -> Edit -> Select Grammar -> Try HTML (defaults to js-beautify beautifier beautifier), and HTML (Ruby - ERB) or JavaScript Template (defaults to prettydiff beautifier ).

Let me know how those go. If either of those work, we can add the Language and select the best beautifier for that language.

@Glavin001 Glavin001 modified the milestones: v0.29.0, v0.28.0 Jun 1, 2015
@Glavin001
Copy link
Owner

Any luck testing with existing language beautifiers?

@kyle7zhang
Copy link
Author

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Tue Jun 02 2015 10:00:25 GMT+0800 (CST).


Platform: darwin

Versions

Atom Version: 0.204.0

Atom Beautify Version: 0.27.10

Original file to be beautified

Original File Path: /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/Comments/CommentsList.cshtml

Original File Grammar: ASP.NET Razor

Original File Contents:

@{
    ViewBag.Title = "CommentsList";
}
@model Estay.Web.Admin.Models.CommentsModel
@section styles {
    <link rel="stylesheet" href="../../assets/css/List.css" />
}
<div class="row">
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">评论列表:</h3>
            </div>
            <div class="panel-body table-responsive">
                <div class="list--btns">
                    @*<a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加点赞量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加阅读量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加分享量</a>*@
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">添加评论</a>
                </div>
                <table class="table table-hover">
                    @if (Model.CommentsList == null)
                    {
                        <tr>
                            <td>没有评论数据!</td>
                        </tr>
                    }
                    else
                    {
                        <tr>
                            <td>编号</td>
                            <td>评论内容</td>
                            <td>评价等级</td>
                            <td>是否显示</td>
                        </tr>
                        foreach (var item in Model.CommentsList.Rows)
                        {
                        <tr>
                            <td>@item.Id</td>
                            <td>@item.Content</td>
                            <td>@item.Star</td>
                            <td>@item.IsShow</td>
                        </tr>
                        }
                    }
                </table>
                @Html.WebPager(Model.CommentsList)
            </div>
        </div>
    </div>
</div>

Beautification options

Editor Options:
Options from Atom Editor settings

{
    "_default": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_with_tabs": false
    }
}

Config Options:
Options from Atom Beautify package settings

{
    "js": {
        "keep_array_indentation": true,
        "keep_function_indentation": true,
        "space_after_anon_function": true,
        "indent_size": 2,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "css": {
        "indent_size": 2,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false
    },
    "d": {
        "configPath": ""
    },
    "fortran": {
        "emacs_path": "",
        "emacs_script_path": ""
    },
    "html": {
        "indent_inner_html": false,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false
    },
    "java": {
        "configPath": ""
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "php": {
        "cs_fixer_path": "",
        "fixers": "",
        "level": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 2,
        "ignore": [
            "E24"
        ]
    },
    "sql": {
        "indent_size": 2,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options:
Options from /Users/Edwin/.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options:
Options from EditorConfig file

{
    "_default": {}
}

Project Options:
Options from .jsbeautifyrc files starting from directory /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/Comments and going up to root

[
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    }
]

Results

Beautified File Contents:

null

Logs:

2015-06-02T02:00:25.422Z - info: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautify @{
    ViewBag.Title = "CommentsList";
}
@model Estay.Web.Admin.Models.CommentsModel
@section styles {
    <link rel="stylesheet" href="../../assets/css/List.css" />
}
<div class="row">
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">评论列表:</h3>
            </div>
            <div class="panel-body table-responsive">
                <div class="list--btns">
                    @*<a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加点赞量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加阅读量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加分享量</a>*@
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">添加评论</a>
                </div>
                <table class="table table-hover">
                    @if (Model.CommentsList == null)
                    {
                        <tr>
                            <td>没有评论数据!</td>
                        </tr>
                    }
                    else
                    {
                        <tr>
                            <td>编号</td>
                            <td>评论内容</td>
                            <td>评价等级</td>
                            <td>是否显示</td>
                        </tr>
                        foreach (var item in Model.CommentsList.Rows)
                        {
                        <tr>
                            <td>@item.Id</td>
                            <td>@item.Content</td>
                            <td>@item.Star</td>
                            <td>@item.IsShow</td>
                        </tr>
                        }
                    }
                </table>
                @Html.WebPager(Model.CommentsList)
            </div>
        </div>
    </div>
</div>
 [ { _default: { indent_size: 2, indent_char: ' ', indent_with_tabs: false } },
  { js: 
     { keep_array_indentation: true,
       keep_function_indentation: true,
       space_after_anon_function: true,
       indent_size: 2,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    css: 
     { indent_size: 2,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false },
    d: { configPath: '' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false },
    java: { configPath: '' },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    php: { cs_fixer_path: '', fixers: '', level: '' },
    python: { max_line_length: 79, indent_size: 2, ignore: [Object] },
    sql: { indent_size: 2, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] ASP.NET Razor /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/Comments/CommentsList.cshtml
2015-06-02T02:00:25.422Z - verbose: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee]  indent_size=2, indent_char= , indent_with_tabs=false, keep_array_indentation=true, keep_function_indentation=true, space_after_anon_function=true, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, brace_style=collapse, break_chained_methods=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, configPath=, configPath=, configPath=, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, max_line_length=79, indent_size=2, ignore=[E24], indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , , , , , , , 
2015-06-02T02:00:25.423Z - verbose: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee] [] 'ASP.NET Razor' 'cshtml'

Yes, It will not provide any errors via your solution when I change the beautifier, nonetheless, the beautifier cannot beautify the razor code(the razor part), It recognize the whole file(.cshtml) as plain HTML, can you update it?

@Glavin001
Copy link
Owner

Did you force Atom to treat your file as another grammar?

My comment from above:

 Atom -> Menu -> Edit -> Select Grammar -> Try HTML(defaults to js-beautify beautifierbeautifier), and HTML (Ruby - ERB)or JavaScript Template (defaults to prettydiff beautifier ).

I notice in your Help Debug Editor results that is still shows the Razor grammar, and not a different/supported grammar. Please change it to something else, as I instructed in my previous comment. Once we find a beautifer that works, we can add the language to support this file officially. 


Sent from Mailbox

On Mon, Jun 1, 2015 at 11:03 PM, Edwin Zhang notifications@github.com
wrote:

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Tue Jun 02 2015 10:00:25 GMT+0800 (CST).

Platform: darwin

Versions

Atom Version: 0.204.0
Atom Beautify Version: 0.27.10

Original file to be beautified

Original File Path: /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/Comments/CommentsList.cshtml
Original File Grammar: ASP.NET Razor
Original File Contents:

@{
    ViewBag.Title = "CommentsList";
}
@model Estay.Web.Admin.Models.CommentsModel
@section styles {
    <link rel="stylesheet" href="../../assets/css/List.css" />
}
<div class="row">
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">评论列表:</h3>
            </div>
            <div class="panel-body table-responsive">
                <div class="list--btns">
                    @*<a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加点赞量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加阅读量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加分享量</a>*@
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">添加评论</a>
                </div>
                <table class="table table-hover">
                    @if (Model.CommentsList == null)
                    {
                        <tr>
                            <td>没有评论数据!</td>
                        </tr>
                    }
                    else
                    {
                        <tr>
                            <td>编号</td>
                            <td>评论内容</td>
                            <td>评价等级</td>
                            <td>是否显示</td>
                        </tr>
                        foreach (var item in Model.CommentsList.Rows)
                        {
                        <tr>
                            <td>@item.Id</td>
                            <td>@item.Content</td>
                            <td>@item.Star</td>
                            <td>@item.IsShow</td>
                        </tr>
                        }
                    }
                </table>
                @Html.WebPager(Model.CommentsList)
            </div>
        </div>
    </div>
</div>

Beautification options

Editor Options:
Options from Atom Editor settings

{
    "_default": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_with_tabs": false
    }
}

Config Options:
Options from Atom Beautify package settings

{
    "js": {
        "keep_array_indentation": true,
        "keep_function_indentation": true,
        "space_after_anon_function": true,
        "indent_size": 2,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cpp": {
        "configPath": ""
    },
    "css": {
        "indent_size": 2,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "preserve_newlines": false
    },
    "d": {
        "configPath": ""
    },
    "fortran": {
        "emacs_path": "",
        "emacs_script_path": ""
    },
    "html": {
        "indent_inner_html": false,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false
    },
    "java": {
        "configPath": ""
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "php": {
        "cs_fixer_path": "",
        "fixers": "",
        "level": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 2,
        "ignore": [
            "E24"
        ]
    },
    "sql": {
        "indent_size": 2,
        "keywords": "upper",
        "identifiers": "lower"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options:
Options from /Users/Edwin/.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options:
Options from EditorConfig file

{
    "_default": {}
}

Project Options:
Options from .jsbeautifyrc files starting from directory /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/Comments and going up to root

[
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    }
]

Results

Beautified File Contents:

null

Logs:

2015-06-02T02:00:25.422Z - info: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee] beautify @{
    ViewBag.Title = "CommentsList";
}
@model Estay.Web.Admin.Models.CommentsModel
@section styles {
    <link rel="stylesheet" href="../../assets/css/List.css" />
}
<div class="row">
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">评论列表:</h3>
            </div>
            <div class="panel-body table-responsive">
                <div class="list--btns">
                    @*<a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加点赞量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加阅读量</a>
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">增加分享量</a>*@
                    <a class="btn btn-success" href="Add?TargetId=@Model.TargetId&TargetType=@Model.TargetType" role="button">添加评论</a>
                </div>
                <table class="table table-hover">
                    @if (Model.CommentsList == null)
                    {
                        <tr>
                            <td>没有评论数据!</td>
                        </tr>
                    }
                    else
                    {
                        <tr>
                            <td>编号</td>
                            <td>评论内容</td>
                            <td>评价等级</td>
                            <td>是否显示</td>
                        </tr>
                        foreach (var item in Model.CommentsList.Rows)
                        {
                        <tr>
                            <td>@item.Id</td>
                            <td>@item.Content</td>
                            <td>@item.Star</td>
                            <td>@item.IsShow</td>
                        </tr>
                        }
                    }
                </table>
                @Html.WebPager(Model.CommentsList)
            </div>
        </div>
    </div>
</div>
 [ { _default: { indent_size: 2, indent_char: ' ', indent_with_tabs: false } },
  { js: 
     { keep_array_indentation: true,
       keep_function_indentation: true,
       space_after_anon_function: true,
       indent_size: 2,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false },
    cs: { configPath: '' },
    c: { configPath: '' },
    cpp: { configPath: '' },
    css: 
     { indent_size: 2,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       preserve_newlines: false },
    d: { configPath: '' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    html: 
     { indent_inner_html: false,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false },
    java: { configPath: '' },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    php: { cs_fixer_path: '', fixers: '', level: '' },
    python: { max_line_length: 79, indent_size: 2, ignore: [Object] },
    sql: { indent_size: 2, keywords: 'upper', identifiers: 'lower' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] ASP.NET Razor /Volumes/C/estay/estay_SNS/Presentation/Estay.Web.Admin/Views/Comments/CommentsList.cshtml
2015-06-02T02:00:25.422Z - verbose: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee]  indent_size=2, indent_char= , indent_with_tabs=false, keep_array_indentation=true, keep_function_indentation=true, space_after_anon_function=true, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, brace_style=collapse, break_chained_methods=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, configPath=, configPath=, configPath=, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, preserve_newlines=false, configPath=, emacs_path=, emacs_script_path=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, configPath=, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, max_line_length=79, indent_size=2, ignore=[E24], indent_size=2, keywords=upper, identifiers=lower, configPath=, , , , , , , , , , 
2015-06-02T02:00:25.423Z - verbose: [/Users/Edwin/.atom/packages/atom-beautify/src/beautifiers/index.coffee] [] 'ASP.NET Razor' 'cshtml'

Yes, It will not provide any errors via your solution when I change the beautifier, nonetheless, the beautifier cannot beautify the razor code(the razor part), It recognize the whole file(.cshtml) as plain HTML, can you update it?

Reply to this email directly or view it on GitHub:
#319 (comment)

@jeffmdemers
Copy link

I tried html, javascript, html (rails), razor and php. None work.

@prettydiff
Copy link
Collaborator

Although this is the original thread I am consolidating to #612 as it a clean start requesting a language where that is not currently supported by present beautifiers. A new beautifier is suggested, though.

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

5 participants