1
+ import * as fs from "fs-extra" ;
2
+ import { ObjectMap } from "pontx-spec" ;
1
3
import * as vscode from "vscode" ;
2
- import { htmlTemplate } from "./utils" ;
3
- import * as path from "path" ;
4
4
import { alicloudAPIMessageService } from "./Service" ;
5
- import { ObjectMap } from "pontx-spec" ;
6
- import * as fs from "fs-extra" ;
5
+ import { htmlTemplate } from "./utils" ;
7
6
export type PanelConfig = {
8
7
specName : string ;
9
8
modName : string ;
@@ -47,13 +46,13 @@ export class AlicloudAPIWebview {
47
46
openTab ( extensionUri : vscode . Uri , panelConfig : PanelConfig ) {
48
47
const panelKey = getPanelKey ( panelConfig ) ;
49
48
const activeEditor = vscode . window . activeTextEditor ;
50
- const getViewColumn = ( ) => {
49
+ const getViewColumn = ( ) => {
51
50
if ( activeEditor && vscode . window . visibleTextEditors . length > 1 ) {
52
51
return activeEditor . viewColumn ;
53
52
} else {
54
- return vscode . ViewColumn . Two ;
53
+ return activeEditor ? vscode . ViewColumn . Two : vscode . ViewColumn . Active ;
55
54
}
56
- }
55
+ } ;
57
56
const column = getViewColumn ( ) ;
58
57
59
58
let webview = AlicloudAPIWebview . webviewPanels [ panelKey ] ;
@@ -71,7 +70,7 @@ export class AlicloudAPIWebview {
71
70
{
72
71
// Enable javascript in the webview
73
72
enableScripts : true ,
74
- retainContextWhenHidden : true
73
+ retainContextWhenHidden : true ,
75
74
} ,
76
75
) ;
77
76
webview = AlicloudAPIWebview . webviewPanels [ panelKey ] ;
@@ -121,7 +120,7 @@ export class AlicloudAPIWebview {
121
120
{
122
121
// Enable javascript in the webview
123
122
enableScripts : true ,
124
- retainContextWhenHidden : true
123
+ retainContextWhenHidden : true ,
125
124
} ,
126
125
) ;
127
126
const filewatcher = vscode . workspace . createFileSystemWatcher ( filePath , true , false , true ) ;
0 commit comments