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条)