From a390fb854b2103c92a170c0ec568c5052d0b0350 Mon Sep 17 00:00:00 2001 From: giscafer Date: Tue, 18 Aug 2020 11:53:00 +0800 Subject: [PATCH] chore: .eidtorconfig maxline code --- .editorconfig | 2 +- src/ReusedWebviewPanel.ts | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index 269c1b7b..5df5d148 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true quote_type = single -max_line_length = 140 +max_line_length = 120 [*.md] insert_final_newline = false diff --git a/src/ReusedWebviewPanel.ts b/src/ReusedWebviewPanel.ts index f75f88af..580c8bc3 100644 --- a/src/ReusedWebviewPanel.ts +++ b/src/ReusedWebviewPanel.ts @@ -1,10 +1,4 @@ -import { - window, - ViewColumn, - WebviewPanel, - WebviewPanelOptions, - WebviewOptions, -} from "vscode"; +import { window, ViewColumn, WebviewPanel, WebviewPanelOptions, WebviewOptions } from 'vscode'; module ReusedWebviewPanel { const webviewPanelsPool: Map = new Map(); // webviewPanel池 @@ -30,17 +24,12 @@ module ReusedWebviewPanel { return oldPanel; } - const newPanel = window.createWebviewPanel( - viewType, - title, - showOptions, - options - ); + const newPanel = window.createWebviewPanel(viewType, title, showOptions, options); newPanel.onDidDispose(() => webviewPanelsPool.delete(viewType)); webviewPanelsPool.set(viewType, newPanel); - console.log("webviewPanelsPool.size:", webviewPanelsPool.size); + console.log('webviewPanelsPool.size:', webviewPanelsPool.size); return newPanel; } @@ -54,7 +43,6 @@ module ReusedWebviewPanel { if (target) { webviewPanelsPool.delete(viewType); - // createWebviewPanel是异步的,setTimeout避免创建未完成时调用dispose报错 setTimeout(() => target.dispose(), 0); }