From 799dad73a159776dde0adb6ca046a34a58934ecf Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 10 Jul 2018 10:11:49 +0800 Subject: [PATCH] (GH-1413) Resolve promise correctly in Folding feature 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. --- src/features/Folding.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/Folding.ts b/src/features/Folding.ts index 2a793b00d7..105b85d1c2 100644 --- a/src/features/Folding.ts +++ b/src/features/Folding.ts @@ -545,8 +545,8 @@ export class FoldingFeature implements IFeature { // Branching for the different vscode-textmate modules if ("loadGrammarFromPathSync" in registry) { // V3 of the module allows synchronous loading of a grammar - return new Promise( (grammar) => { - return registry.loadGrammarFromPathSync(grammarPath); + return new Promise( (resolve) => { + resolve(registry.loadGrammarFromPathSync(grammarPath)); }); } else { // However in V4+ this is async only