misc tuning and clarification;
authorwenzelm
Wed, 26 Feb 2020 15:34:52 +0100
changeset 71478 5c0293826dc8
parent 71477 24e3adaee6ec
child 71479 6aa2dc263912
misc tuning and clarification;
src/Tools/VSCode/extension/src/state_panel.ts
--- a/src/Tools/VSCode/extension/src/state_panel.ts	Wed Feb 26 14:47:36 2020 +0100
+++ b/src/Tools/VSCode/extension/src/state_panel.ts	Wed Feb 26 15:34:52 2020 +0100
@@ -2,10 +2,8 @@
 
 import * as library from './library'
 import * as protocol from './protocol'
-import { Content_Provider } from './content_provider'
-import { LanguageClient, VersionedTextDocumentIdentifier } from 'vscode-languageclient';
-import { Uri, ExtensionContext, workspace, commands, window, Webview, WebviewPanel, ViewColumn } from 'vscode'
-import { create } from 'domain';
+import { LanguageClient } from 'vscode-languageclient';
+import { Uri, ExtensionContext, window, WebviewPanel, ViewColumn } from 'vscode'
 
 
 let language_client: LanguageClient
@@ -23,10 +21,10 @@
   public get_id(): number { return this.state_id }
   public check_id(id: number): boolean { return this.state_id == id }
 
-  public set_content(id: number, html: string)
+  public set_content(id: number, body: string)
   {
     this.state_id = id
-    this.webview_panel.webview.html = html
+    this.webview_panel.webview.html = body
   }
 
   public reveal()
@@ -65,16 +63,8 @@
   }
 }
 
-
-/* global panel */
-
 let panel: Panel
 
-function check_panel(id: number): boolean
-{
-  return panel && panel.check_id(id)
-}
-
 function exit_panel()
 {
   if (panel) {
@@ -85,8 +75,10 @@
 
 export function init(uri: Uri)
 {
-  if (panel) panel.reveal()
-  else language_client.sendNotification(protocol.state_init_type)
+  if (language_client) {
+    if (panel) panel.reveal()
+    else language_client.sendNotification(protocol.state_init_type)
+  }
 }
 
 export function setup(context: ExtensionContext, client: LanguageClient)