mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Update to target VS Code 1.25+
This commit is contained in:
@ -19,10 +19,9 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
}));
|
||||
|
||||
// Serializers only introduced in VS Code 1.25+
|
||||
if ((vscode.window as any).registerWebviewPanelSerializer) {
|
||||
if (vscode.window.registerWebviewPanelSerializer) {
|
||||
// Make sure we register a serilizer in activation event
|
||||
(vscode.window as any).registerWebviewPanelSerializer(CatCodingPanel.viewType, {
|
||||
vscode.window.registerWebviewPanelSerializer(CatCodingPanel.viewType, {
|
||||
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel, state: any) {
|
||||
console.log(`Got state: ${state}`);
|
||||
CatCodingPanel.revive(webviewPanel, context.extensionPath);
|
||||
@ -125,6 +124,8 @@ class CatCodingPanel {
|
||||
}
|
||||
|
||||
private _update() {
|
||||
|
||||
const z = 1 + 2;
|
||||
// Vary the webview's content based on where it is located in the editor.
|
||||
switch (this._panel.viewColumn) {
|
||||
case vscode.ViewColumn.Two:
|
||||
|
||||
Reference in New Issue
Block a user