title: Why decorations and data is not updating in my VScode extension?
body: <p>I am trying to write quokka.js like vscode extension. I am using decorations api to display vars const let values in editor and chrome dev tools inspector node api to run and compile code. In activate function I am subscribing to vscode save document event and getting the values from global scope. But it is working only once. Than data don't updates. Why?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Import the module and reference it with the alias vscode in your code below
  import * as vscode from 'vscode';
  import * as inspector from 'inspector';
  import * as path from 'path';
  import * as util from 'util';
  import { memoryUsage, versions } from 'process';
  import * as fs from 'fs';
  import * as kill from 'tree-kill';
  
  // console.log(vscode.Disposable);
  
  const activeTextEditor = vscode.window.activeTextEditor;
  
  let decorationTypes: any = [];
  
  const makeDecorationWithText = (
      contentText: string,
      line: number,
      column: number,
      activeEditor: vscode.TextEditor
  ) =&gt; {
      const decorationType = vscode.window.createTextEditorDecorationType({
          after: {
              contentText,
              margin: '20px'
          }
      });
  
      decorationTypes.push(decorationType);
  
      const range = new vscode.Range(
          new vscode.Position(line, column),
          new vscode.Position(line, column)
      );
  
      activeEditor.setDecorations(decorationType, [{ range }]);
  };
  
  const clearDecorations = () =&gt; {
      if (decorationTypes.length &gt; 0) {
          for (let i = 0; i &lt; decorationTypes.length; i++) {
              activeTextEditor?.setDecorations(decorationTypes[i], []);
              decorationTypes[i].dispose();
          }
          decorationTypes = [];
      } else {
          vscode.window.showInformationMessage('Array is empty');
      }
  };
  
  export async function activate(context: vscode.ExtensionContext) {
      clearDecorations();
  
      let disposable = vscode.commands.registerCommand('coderunner3.coderun', async () =&gt; {
  
  
          vscode.window.showInformationMessage('Coderun is working!');
  
          vscode.workspace.onDidSaveTextDocument(async () =&gt; {
              const session = new inspector.Session();
              session.connect();
  
              const post = &lt;any&gt;util.promisify(session.post).bind(session);
              clearDecorations();
              // await post('Memory.forciblyPurgeJavaScriptMemory');
              await post('Runtime.disable');
              // await post('Runtime.addBinding', 'variables');
              await post('Runtime.enable');
              await post('Debugger.enable');
              const activeEditor = vscode.window.activeTextEditor;
              if (!activeEditor) {
                  return;
              }
              const document = activeEditor.document;
              const filename = path.basename(document.uri.toString());
              const { scriptId } = await post('Runtime.compileScript',
                  {
                      expression: vscode.window.activeTextEditor?.document.getText(),
                      sourceURL: filename,
                      persistScript: true
                  });
              // console.log(scriptId);
              await post('Runtime.runScript', { scriptId });
              const data = await post('Runtime.globalLexicalScopeNames', {
                  executionContextId: 1
              });
  
              // console.log(data.names[0]);
  
              data.names.map(async (expression: string) =&gt; {
                  console.log(expression);
                  const executionResult = await post('Runtime.evaluate', { expression, contextId: 1 });
                  const { value } = executionResult.result;
                  // console.log(executionResult.result);
                  const { result } = await post('Debugger.searchInContent', {
                      scriptId, query: expression
                  });
                  // for(let i = 0; i &lt; result.length; i++) {
                  //  let test = await post('Runtime.evaluate', { expression: result[i].lineContent, contextId: 1 });
                  //  console.log(test);
                  // }
                  // console.log(executionResult);
                  makeDecorationWithText(`${value}`, result[0].lineNumber, result[0].lineContent.length, activeEditor);
              });
              await post('Runtime.disable');
              await post('Debugger.disable');
              // await post('Debugger.setBreakpoint', { scriptId, lineNumber: 1 });
              // await post('CacheStorage.deleteCache', { cacheId: scriptId });
              session.disconnect();
          });
      });
  
      context.subscriptions.push(disposable);
  }
  
  export function deactivate() {
      clearDecorations();
  }</code></pre>
  </div>
  </div>
  </p>
  <p><img src="https://i.stack.imgur.com/k7B5T.png" alt="1" /></p>