File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,23 @@ import (
5
5
"sync"
6
6
7
7
"github.com/microsoft/typescript-go/internal/ast"
8
- "github.com/microsoft/typescript-go/internal/core"
9
8
)
10
9
11
10
func getRules (context * formattingContext ) []* ruleImpl {
12
11
bucket := getRulesMap ()[getRuleBucketIndex (context .currentTokenSpan .Kind , context .nextTokenSpan .Kind )]
13
12
if len (bucket ) > 0 {
14
13
var rules []* ruleImpl
15
14
ruleActionMask := ruleActionNone
15
+ outer:
16
16
for _ , rule := range bucket {
17
17
acceptRuleActions := ^ getRuleActionExclusion (ruleActionMask )
18
- if rule .Action ()& acceptRuleActions != 0 && core .Every (rule .Context (), func (cb func (ctx * formattingContext ) bool ) bool { return cb (context ) }) {
18
+ if rule .Action ()& acceptRuleActions != 0 {
19
+ preds := rule .Context ()
20
+ for _ , p := range preds {
21
+ if ! p (context ) {
22
+ continue outer
23
+ }
24
+ }
19
25
rules = append (rules , rule )
20
26
ruleActionMask |= rule .Action ()
21
27
}
You can’t perform that action at this time.
0 commit comments