mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
apply decreaseIndent for ruby code
This commit is contained in:
parent
bf38fbef59
commit
db979de520
|
@ -1,8 +1,10 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
16
extensions/ruby/src/rubyMain.ts
Normal file
16
extensions/ruby/src/rubyMain.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* 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\\!?]*[!?]?)/
|
||||
});
|
||||
}
|
10
extensions/ruby/src/typings/ref.d.ts
vendored
Normal file
10
extensions/ruby/src/typings/ref.d.ts
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* 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'/>
|
12
extensions/ruby/tsconfig.json
Normal file
12
extensions/ruby/tsconfig.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"outDir": "./out",
|
||||
"noLib": true,
|
||||
"sourceMap": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue