This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,22 @@ exports.activate = function () {
6161 }
6262 } )
6363 }
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+
6480}
6581
6682const STYLED_REGEX = / \b s t y l e d \b / i
Original file line number Diff line number Diff line change 1111 ' decreaseIndentPattern' : ' (?x)
1212 ^ \\ s* (\\ s* /[*] .* [*]/ \\ s*)* [}\\ ])]
1313 '
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