提交 db979de5 编写于 作者: R rebornix

apply decreaseIndent for ruby code

上级 bf38fbef
{
"name": "ruby",
"version": "0.1.0",
"version": "0.2.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
"activationEvents": ["onLanguage:ruby"],
"main": "./out/rubyMain",
"contributes": {
"languages": [{
"id": "ruby",
......@@ -17,5 +19,9 @@
"scopeName": "source.ruby",
"path": "./syntaxes/Ruby.plist"
}]
},
"scripts": {
"compile": "gulp compile-extension:ruby",
"watch": "gulp watch-extension:ruby"
}
}
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ExtensionContext, languages } from 'vscode';
export function activate(context: ExtensionContext): any {
languages.setLanguageConfiguration('ruby', {
indentationRules: {
increaseIndentPattern: /^\s*((begin|class|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while)|(.*\sdo\b))\b[^\{;]*$/,
decreaseIndentPattern: /^\s*([}\]]([,)]?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/
},
wordPattern: /(-?\d+(?:\.\d+))|(:?[A-Za-z][^-`~@#%^&()=+[{}|;:'",<>/.*\]\s\\!?]*[!?]?)/
});
}
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/typings/mocha.d.ts'/>
/// <reference path='../../../../extensions/node.d.ts'/>
/// <reference path='../../../../extensions/lib.core.d.ts'/>
/// <reference path='../../../../extensions/declares.d.ts'/>
\ No newline at end of file
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"outDir": "./out",
"noLib": true,
"sourceMap": true
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册