Skip to content

Commit 7a9df00

Browse files
glennsartirjmholt
authored andcommitted
(GH-1413) Resolve promise correctly in Folding feature (#1416)
Previously in PR #1414 the Folding provider was updated, however the promise resolution was incorrect. This caused the grammar load to never trigger the Then command. This commit instead uses the correct way to return the value for the promise and, when then triggers the Then statement correctly.
1 parent 77da510 commit 7a9df00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/features/Folding.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ export class FoldingFeature implements IFeature {
545545
// Branching for the different vscode-textmate modules
546546
if ("loadGrammarFromPathSync" in registry) {
547547
// V3 of the module allows synchronous loading of a grammar
548-
return new Promise( (grammar) => {
549-
return registry.loadGrammarFromPathSync(grammarPath);
548+
return new Promise( (resolve) => {
549+
resolve(registry.loadGrammarFromPathSync(grammarPath));
550550
});
551551
} else {
552552
// However in V4+ this is async only

0 commit comments

Comments
 (0)