全新 Cloud Studio 已经上线
插件市场
/
插件详情
EditorConfigPlus
①读取项目中的.editorconfig文件并将其配置应用于编辑器 ②附加功能:.editorconfig文件新增配置项lang_id和lang_ext,本插件会将编辑器语言设置成所设置的
(1 人评分)
评分

EditorConfig Plus

根据文档,目前编辑器自身已支持.editorconfig,您可以直接关注本插件的附加功能部分

基本功能

详见EditorConfig官网

目前支持的功能有:

  • indent_style
  • indent_size
  • tab_width
  • trim_trailing_whitespace
  • end_of_line

我目前找不到其他功能的实现方法,如果有解决方案,欢迎告诉我。

比如insert_final_newline的实现我认为需要编辑器文件保存事件,然而我没有找到相应的api。

附加功能

不在editorconfig标准內的功能,这是由于目前cloudstudio的一些不足才添加的。

lang_ext

将编辑器中当前文件的语言id设为以lang_ext的值为拓展名的源文件的语言id。

lang_id

将编辑器中当前文件的语言id设为lang_id的值

提醒:我不知道为什么Groovy的language id是grovvy,所以为了避免踩坑,建议使用lang_ext这一配置项。

示例

# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Set language association
[*.gradle]
lang_ext = groovy

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

License

The MIT License (MIT)

Copyright (c) 2019 Cecil Lin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

分类
编辑器功能增强
更多信息
版本1.0.2
发布时间2019/01/30 10:51
分享给好友
使用微信扫描二维码
然后分享给好友
用户评价
暂无评价
联系我们
电话
400-930-9163
腾讯云开发者平台由腾讯云及 CODING 共同运营,目前由 CODING 团队提供运营服务。