最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论