EditorConfig 以纯原生无需任何插件支持 EditorConfig 代码风格配置的编辑器:

Visual Studio 2017 开始添加了对 EditorConfig 的原生支持。Visual Studio 一旦检测到 .editorconfig 文件的存在,格式约定就会自动生效。

Visual Studio 中 .NET 相关语言(C# VB)的 EditorConfig 属性,可以参考 .NET coding convention settings For EditorConfig

设置EditorConfig所需插件: EditorConfig Language Service 和 Visual Studio IntelliCode

EditorConfig Language Service 生成的 .editorconfig 文件是空的。

IntelliCode 一经添加便提供了丰富的 C# 语言约定的属性设置。不过,IntelliCode 提供的设置多少取决于你目前解决方案中的项目类型。

如果你使用 EditorConfig Language Service 生成了 .editorconfig 文件,则可以继续点击小灯泡生成按照微软约定的编程规范。

C#简单配置:

[*]
end_of_line = crlf
charset = utf-
indent_size =
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space [*.cs]
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = flush_left
csharp_indent_switch_labels = true
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
csharp_prefer_braces = true:silent
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_around_binary_operators = before_and_after
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_var_elsewhere = true:silent
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent

编程风格统一配置EditorConfig的更多相关文章

  1. 浅谈前端JavaScript编程风格

    前言 多家公司和组织已经公开了它们的风格规范,详细可參阅jscs.info,以下的内容主要參考了Airbnb的JavaScript风格规范.当然还有google的编程建议等编程风格 本章探讨怎样使用E ...

  2. 《Essential C++》读书笔记 之 基于对象编程风格

    <Essential C++>读书笔记 之 基于对象编程风格 2014-07-13 4.1 如何实现一个class 4.2 什么是Constructors(构造函数)和Destructor ...

  3. 【Spring】SpringMVC之REST编程风格

    REST架构是一个抽象的概念,目前主要是基于HTTP协议实现,其目的是为了提高系统的可伸缩性.降低应用之间的耦合度.便于架构分布式处理程序.当使用多种语言进行开发的时候,每一种语言对URL的处理不同, ...

  4. [转]ECMAScript 6 入门 -编程风格

    本文转自:http://es6.ruanyifeng.com/#docs/style 编程风格 块级作用域 字符串 解构赋值 对象 数组 函数 Map结构 Class 模块 ESLint的使用 本章探 ...

  5. ES6学习笔记(二十一)编程风格

    本章探讨如何将 ES6 的新语法,运用到编码实践之中,与传统的 JavaScript 语法结合在一起,写出合理的.易于阅读和维护的代码. 1.块级作用域 (1)let 取代 var ES6 提出了两个 ...

  6. 个人c语言编程风格总结

    总结一下我个人的编程风格及这样做的原因吧,其实是为了给实验室写一个统一的C语言编程规范才写的.首先声明,我下面提到的编程规范,是自己给自己定的,不是c语言里面规定的. 一件事情,做成和做好中间可能隔了 ...

  7. Google Java编程风格指南

    出处:http://hawstein.com/posts/google-java-style.html 声明:本文采用以下协议进行授权: 自由转载-非商用-非衍生-保持署名|Creative Comm ...

  8. Google Java编程风格指南中文版

    作者:Hawstein出处:http://hawstein.com/posts/google-java-style.html声明:本文采用以下协议进行授权: 自由转载-非商用-非衍生-保持署名|Cre ...

  9. Java学习笔记(六)——google java编程风格指南(下)

    [前面的话] 年后开始正式上班,计划着想做很多事情,但是总会有这样那样的打扰,不知道是自己要求太高还是自我的奋斗意识不够?接下来好好加油.好好学学技术,好好学习英语,好好学习做点自己喜欢的事情,趁着自 ...

随机推荐

  1. shebang是啥

    在计算领域中,Shebang(也称为 Hashbang )是一个由井号和叹号构成的字符序列 #! ,其出现在文本文件的第一行的前两个字符. 在文件中存在 Shebang 的情况下,类 Unix 操作系 ...

  2. .net framework msbuild环境搭建 (不装vs)

    1. 安装 .net framework sdk 小于等于 .net framework 4.5 版本的 .net framework sdk 通过 windows sdk 工具安装 从下面额链接找到 ...

  3. shell基础知识8-xargs命令

    简介 xargs 命令应该紧跟在管道操作符之后.它使用标准输入作为主要的数据源,将从 stdin 中 读取的数据作为指定命令的参数并执行该命令. 将多行输入转换成单行输出 [root@dns-node ...

  4. Windows10 下安装 oracle 客户端,安装 plsql 破解并实现汉化

    一,软件准备 1,win10 操作系统 2,oracle_11g_r2 client 这里是 64 位的软件  3, plsql 11.0.6 这里我们下载 64 的,32 位操作系统现在已经很少了, ...

  5. SQL中merge into用法

    从备份表中更新字段到正式表中,使用 UPDATE 批量更新大量的数据,会出现效率低下,有时候甚至卡死的情况,后面通过使用 MERGE INTO 代替 UPDATE 执行批量更新,会提升执行效率. ME ...

  6. Mac下 homebrew 安装mysql

    操作步骤 安装homebrew brew install mysql 安装mysql 安装完成之后,可以运行命令启动mysql服务 mysql.server start 然后输入命令设置密码 mysq ...

  7. xunit 单元测试

    代码:GitHub 参考地址:https://github.com/Acumatica/xunit.autofac xunit +autofac进行单元测试 ①创建一个类库 引用nuget: xuni ...

  8. 2019年新加坡之行 Day 1

    又到了公司每年一次的年度旅游,继前几年的香港.日本.韩国游后,今年公司选择了新加坡.由于之前曾在新加坡公司The Adventus Consultants工作过2年时间,所以对于这次重返新加坡,我还是 ...

  9. 搭建基于docker 的redis分布式集群在docker for windows

    https://blog.csdn.net/xielinrui123/article/details/85104446 首先在docker中下载使用 docker pull redis:3.0.7do ...

  10. 【jquery】【ztree】节点添加自定义按钮、编辑和删除事件改成自己定义事件

    setting添加 edit: { drag: { isCopy: false, isMove: true }, enable: true,//设置是否处于编辑状态 showRemoveBtn: sh ...