I am working on developing a VSCode extension, and I open a webview using the following:
const panel = vscode.window.createWebviewPanel(
'webviewName', // Identifies the type of the webview. Used internally
'Webview Title', // Title of the panel displayed to the user
vscode.ViewColumn.Two, // Editor column to show the new webview panel in.
{} // Webview options.
);
Note the ViewColumn.Two
argument that is passed to it. This affects which view column the webview becomes a part of.
My intended behavior is for the webview is to ALWAYS open to the side. This means that if the user has one file open, then I can open it in ViewColumn 2. However, if they had two files open side-by-side, I'd need to open it in ViewColumn three, and so forth.
How do I get the number of ViewColumns in the current window from the VSCode API?
Also a note: The visual-studio-code-extensions tag does not exist. I want to create it but I don't have enough rep.