This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,22 @@ exports.activate = function () {
61
61
}
62
62
} )
63
63
}
64
+
65
+ // This feels hacky. Better suggestions welcome.
66
+ const grammar = atom . grammars . grammarForId ( 'source.js' )
67
+ grammar . precedingRowConditions = ( node ) => (
68
+ ( node . parent . type == 'while_statement' && node . type != 'statement_block' )
69
+ || ( node . parent . type == 'jsx_self_closing_element' && node . type != '/' )
70
+ || ( node . parent . type == 'if_statement'
71
+ && ( ! ( node . type == 'if_statement'
72
+ && node . previousSibling . type == 'else'
73
+ && node . previousSibling . startPosition . row == node . startPosition . row )
74
+ /* not an else-if */
75
+ )
76
+ && node . type != 'statement_block'
77
+ && node . type != 'else' )
78
+ )
79
+
64
80
}
65
81
66
82
const STYLED_REGEX = / \b s t y l e d \b / i
Original file line number Diff line number Diff line change 11
11
' decreaseIndentPattern' : ' (?x)
12
12
^ \\ s* (\\ s* /[*] .* [*]/ \\ s*)* [}\\ ])]
13
13
'
14
+ scopes :
15
+ indent :
16
+ array : true
17
+ object : true
18
+ arguments : true
19
+ statement_block : true
20
+ class_body : true
21
+ parenthesized_expression : true
22
+ jsx_element : true
23
+ jsx_opening_element : true
24
+ jsx_expression : true
25
+ switch_body : true
26
+ comment : true
27
+ indentExceptFirst :
28
+ member_expression : true
29
+ assignment_expression : true
30
+ expression_statement : true
31
+ variable_declarator : true
32
+ lexical_declaration : true
33
+ binary_expression : true
34
+ types :
35
+ indent : {}
36
+ outdent :
37
+ access_specifier : true
You can’t perform that action at this time.
0 commit comments