You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an extension that works in version 0.10.3 but does not work in 0.10.5+.
The cause of this breakage is that functions on objects passed in the arguments array of a Command were available when executing the actions in 0.10.3 but are not available in 10.5+
This is illustrated in the following example:
classReproimplementsvscode.CodeActionProvider{publiccommandId='hoovercj.reproCommand';privatecommand;constructor(){this.command=vscode.commands.registerCommand(this.commandId,this.runCodeAction,this);}publicprovideCodeActions(document: vscode.TextDocument,range: vscode.Range,context: vscode.CodeActionContext,token: vscode.CancellationToken): vscode.Command[]{return[<vscode.Command>{title: "Broken Command",command: this.commandId,arguments: [document,{broken: ()=>{return5;},works: 5}]}];
}publicrunCodeAction(document: vscode.TextDocument,test:any){try{test.works;test.broken();document.getText();} catch (error) {// This should show up in 10.5+ but should not show up in 10.3vscode.window.showErrorMessage(error);}}
The text was updated successfully, but these errors were encountered:
The issue is that we trigger the action on the main side but cannot serialise over such arguments. Before we would keep them cached on the extension side and create a dummy action for it. Tho, that is likely to result in memory leakage. Needs thinking...
I have an extension that works in version 0.10.3 but does not work in 0.10.5+.
The cause of this breakage is that functions on objects passed in the
arguments
array of aCommand
were available when executing the actions in 0.10.3 but are not available in 10.5+This is illustrated in the following example:
The text was updated successfully, but these errors were encountered: