-
Notifications
You must be signed in to change notification settings - Fork 453
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
Comments
Please run |
Atom Beautify - Debugging informationThe following debugging information was generated by Platform: darwin VersionsAtom Version: 0.196.0 Atom Beautify Version: 0.27.0 Original file to be beautifiedOriginal File Path: 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 optionsEditor Options: {
"indent_size": 2,
"indent_char": " ",
"indent_with_tabs": false
} Config Options: {
"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: {} EditorConfig Options: {} Project Options: [
{},
{},
{},
{},
{},
{},
{},
{}
] ResultsBeautified File Contents: null Logs:
|
+1 |
Thanks @icese7en. Atom Beautify may already be able to handle this language. Also see #230 for C# ASP.NET Web Forms. Could you trick Atom Beautify into treating this file as one of the existing languages: Atom -> Menu -> Let me know how those go. If either of those work, we can add the Language and select the best beautifier for that language. |
Any luck testing with existing language beautifiers? |
Atom Beautify - Debugging informationThe following debugging information was generated by Platform: darwin VersionsAtom Version: 0.204.0 Atom Beautify Version: 0.27.10 Original file to be beautifiedOriginal File Path: 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 optionsEditor Options: {
"_default": {
"indent_size": 2,
"indent_char": " ",
"indent_with_tabs": false
}
} Config Options: {
"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: {
"_default": {}
} EditorConfig Options: {
"_default": {}
} Project Options: [
{
"_default": {}
},
{
"_default": {}
},
{
"_default": {}
},
{
"_default": {}
},
{
"_default": {}
},
{
"_default": {}
},
{
"_default": {}
},
{
"_default": {}
}
] ResultsBeautified File Contents: null Logs:
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? |
Did you force Atom to treat your file as another grammar? My comment from above:
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. — On Mon, Jun 1, 2015 at 11:03 PM, Edwin Zhang notifications@github.com
|
I tried html, javascript, html (rails), razor and php. None work. |
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. |
[Enter steps to reproduce below:]
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'.
Commands
Config
Installed Packages
The text was updated successfully, but these errors were encountered: