Repository navigation
Closed
Labels
Milestone
Description
- VSCode Version: 1.5.1
- OS Version: OSX 10.11.6
I developed an extension for VSCode and since the newest update (this morning) I've got a serious problem:
public addImportPick(activeDocument: TextEditor): Thenable<ResolveQuickPickItem> {
return window.showQuickPick(this.buildQuickPickList(activeDocument));
}buildQuickPickList does produce a Promise
When I call showQuickPick in such a manner, the following error occurs:
TypeError: e.done is not a function
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:6:23142
at new n.Class.derive._oncancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:5:26897)
at f (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:6:23109)
at Object.h [as wireCancellationToken] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:6:23050)
at t.showQuickPick (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:12:14157)
at Object.I.window.showQuickPick (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:12:30588)
at ResolveQuickPickProvider.addImportPick (/Users/christoph/Documents/Development/typescript-hero/out/src/provider/ResolveQuickPickProvider.js:29:32)
at ResolveExtension.addImport (/Users/christoph/Documents/Development/typescript-hero/out/src/extensions/ResolveExtension.js:117:27)
at /Users/christoph/Documents/Development/typescript-hero/out/src/extensions/ResolveExtension.js:74:143
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:12:29049
Is this caused by the update ?
Activity
buehler commentedon Sep 9, 2016
Update: just investigated..
when I resolve the promise myself, it works.
jrieken commentedon Sep 9, 2016
Christoph Bühler (@buehler) Just to confirm my theory -
this.buildQuickPickListreturns a native promise, correct?buehler commentedon Sep 9, 2016
Johannes Rieken (@jrieken) exactly :-)
As a bonus question: why don't you guys use native promises? (Why the
Thenable<>)Edit: I'm actually curious
jrieken commentedon Sep 9, 2016
Yeah - that can only be answered with the history of the project. When we started some time ago there was no native promise yet. We then went with WinJS-promises. Since WinJS.Promise and native promise have incompatibilities (like
done,cancel,progress-callback etc) the migration isn't easy (which is the same for everyone using another promise implementation).WinJS.Promise#as is not what you think it is, use wrap instead - fixes …
hello, monaco.d.ts, #11754
jrieken commentedon Sep 9, 2016
to verify
have an extension that runs the below code (for instance as part of a command) and make sure no errors are thrown
hello, monaco.d.ts, #11754
WinJS.Promise#as is not what you think it is, use wrap instead - fixes …