visual studio code - Passing data to a VSCode extension running in an instance that was started on demand with serve-web - Stack

I'm spinning up VSCode serve-web instances on demand. Each includes an extension (which I've

I'm spinning up VSCode serve-web instances on demand. Each includes an extension (which I've written) that connect to a central signalr endpoint. Not every browser tab gets a new vscode instance, so two browser tabs may use the same vscode serve-web instance.
To give each editor in a browser tab a unique id, it is not enough to pass a generated id to the vscode serve-web instance and since it may serve more than one browser tab.
The api has the vscode.env.sessionId variable which would work as a unique id but it still falls short because by the time I have access to it (i.e. the editor is opened in a tab), I won't be able to reliably match the new instance to the original on demand request. (I'm currently just assuming it is the newest signalr connection.)

I hope the following makes my problem a bit easier to understand:

To try and solve this problem, I added another query parameter to the editor url (i.e. &EditorId=<NewGuid>) and tried to get that parameter in the extension. But I've had no luck accessing that information in the extension.

Is it possible to get the EditorId query parameter in a vscode extension, or achieve the same by other means?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745674262a4639588.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信