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

Commit 6b937f6

Browse files
committed
fix(providers): Fix problem with syntax associations
1 parent 94a46fb commit 6b937f6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/providers/base.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export default class BaseProvider {
3636
}
3737

3838
public isApplycable(): boolean {
39-
return this.supportedSyntaxes().indexOf(this.syntax) !== -1;
39+
const syntax: string = this.getSyntax(this.syntax);
40+
41+
return this.supportedSyntaxes().indexOf(syntax) !== -1;
4042
}
4143

4244
public async format(): Promise<IStyleBlock[]> {
@@ -74,8 +76,6 @@ export default class BaseProvider {
7476
}
7577

7678
public getSyntax(syntax: string): string {
77-
const syntaxAssociation = this.settings.syntaxAssociations[syntax];
78-
79-
return syntaxAssociation || syntax;
79+
return this.settings.syntaxAssociations[syntax] || syntax;
8080
}
8181
}

src/providers/styles.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export default class StylesProvider extends BaseProvider {
3030
content = this.document.getText(range);
3131
}
3232

33-
return [{ syntax: this.syntax, range, content, error: null, changed: false }];
33+
const syntax: string = this.getSyntax(this.syntax);
34+
35+
return [{ syntax, range, content, error: null, changed: false }];
3436
}
3537

3638
public supportedSyntaxes(): string[] {

0 commit comments

Comments
 (0)