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' ;
63import * 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' ;
86import { registerTaskProvider } from './task/rake' ;
7+ import * as utils from './utils' ;
98
109import { registerCompletionProvider } from './providers/completion' ;
1110import { registerFormatter } from './providers/formatter' ;
@@ -15,20 +14,23 @@ import { registerLinters } from './providers/linters';
1514
1615export 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 * ( m o d u l e | c l a s s | ( ( p r i v a t e | p r o t e c t e d ) \s + ) ? d e f | u n l e s s | i f | e l s e | e l s i f | c a s e | w h e n | b e g i n | r e s c u e | e n s u r e | f o r | w h i l e | u n t i l | (? = .* ?\b ( d o | b e g i n | c a s e | i f | u n l e s s ) \b ) ( " ( \\ .| [ ^ \\ " ] ) * " | ' ( \\ .| [ ^ \\ ' ] ) * ' | [ ^ # " ' ] ) * ( \s ( d o | b e g i n | c a s e ) | [ - + = & | * / ~ % ^ < > ~ ] \s * ( i f | u n l e s s ) ) ) \b (? ! [ ^ ; ] * ; .* ?\b e n d \b ) | ( " ( \\ .| [ ^ \\ " ] ) * " | ' ( \\ .| [ ^ \\ ' ] ) * ' | [ ^ # " ' ] ) * ( \( (? ! [ ^ \) ] * \) ) | \{ (? ! [ ^ \} ] * \} ) | \[ (? ! [ ^ \] ] * \] ) ) ) .* $ / ,
22- decreaseIndentPattern : / ^ \s * ( [ } \] ] ( [ , ) ] ? \s * ( # | $ ) | \. [ a - z A - Z _ ] \w * \b ) | ( e n d | r e s c u e | e n s u r e | e l s e | e l s i f | w h e n ) \b ) /
22+ decreaseIndentPattern : / ^ \s * ( [ } \] ] ( [ , ) ] ? \s * ( # | $ ) | \. [ a - z A - Z _ ] \w * \b ) | ( e n d | r e s c u e | e n s u r e | e l s e | e l s i f | w h e n ) \b ) / ,
2323 } ,
24- wordPattern : / ( - ? \d + (?: \. \d + ) ) | ( : ? [ A - Z a - z ] [ ^ - ` ~ @ # % ^ & ( ) = + [ { } | ; : ' " , < > / . * \] \s \\ ! ? ] * [ ! ? ] ? ) /
24+ wordPattern : / ( - ? \d + (?: \. \d + ) ) | ( : ? [ A - Z a - 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