Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 75106ee

Browse files
committed
Minor cleanup of ruby.ts
This isn't fully compliant with the tslint/prettier config but is enough for now
1 parent 075bfc7 commit 75106ee

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/ruby.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
"use strict";
1+
'use strict';
22

3-
import * as vscode from 'vscode';
4-
import { Location, ExtensionContext, Position } from 'vscode';
5-
import * as Locate from './locate/locate';
63
import * as path from 'path';
7-
import * as utils from './utils';
4+
import { ExtensionContext, languages, Location, Position } from 'vscode';
5+
import * as Locate from './locate/locate';
86
import { registerTaskProvider } from './task/rake';
7+
import * as utils from './utils';
98

109
import { registerCompletionProvider } from './providers/completion';
1110
import { registerFormatter } from './providers/formatter';
@@ -15,20 +14,23 @@ import { registerLinters } from './providers/linters';
1514

1615
export function activate(context: ExtensionContext) {
1716
const subs = context.subscriptions;
17+
1818
// register language config
19-
vscode.languages.setLanguageConfiguration('ruby', {
19+
languages.setLanguageConfiguration('ruby', {
2020
indentationRules: {
2121
increaseIndentPattern: /^(\s*(module|class|((private|protected)\s+)?def|unless|if|else|elsif|case|when|begin|rescue|ensure|for|while|until|(?=.*?\b(do|begin|case|if|unless)\b)("(\\.|[^\\"])*"|'(\\.|[^\\'])*'|[^#"'])*(\s(do|begin|case)|[-+=&|*/~%^<>~]\s*(if|unless)))\b(?![^;]*;.*?\bend\b)|("(\\.|[^\\"])*"|'(\\.|[^\\'])*'|[^#"'])*(\((?![^\)]*\))|\{(?![^\}]*\})|\[(?![^\]]*\]))).*$/,
22-
decreaseIndentPattern: /^\s*([}\]]([,)]?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/
22+
decreaseIndentPattern: /^\s*([}\]]([,)]?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/,
2323
},
24-
wordPattern: /(-?\d+(?:\.\d+))|(:?[A-Za-z][^-`~@#%^&()=+[{}|;:'",<>/.*\]\s\\!?]*[!?]?)/
24+
wordPattern: /(-?\d+(?:\.\d+))|(:?[A-Za-z][^-`~@#%^&()=+[{}|;:'",<>/.*\]\s\\!?]*[!?]?)/,
2525
});
2626

27+
// Register providers
2728
registerHighlightProvider(context);
2829
registerLinters(context);
2930
registerCompletionProvider(context);
3031
registerFormatter(context);
3132
registerIntellisenseProvider(context);
3233
registerTaskProvider(context);
34+
3335
utils.loadEnv();
3436
}

0 commit comments

Comments
 (0)