message: Fix issue with extension.packageInfo being undefined when accessed
diff: @@ -141,21 +141,22 @@ function conflictExtensionCheck() {
  }
  function newVersionMessage(extensionPath: string, extension: Extension) {
  + return new Promise((resolve, reject) => {
  fs.readFile(`${extensionPath}${path.sep}package.json`, (err, data) => {
  if (err) {
  extension.logger.addLogMessage('Cannot read package information.')
  - return
  + resolve()
  }
  extension.packageInfo = JSON.parse(data.toString())
  extension.logger.addLogMessage(`LaTeX Workshop version: ${extension.packageInfo.version}`)
  if (fs.existsSync(`${extensionPath}${path.sep}VERSION`) &&
  fs.readFileSync(`${extensionPath}${path.sep}VERSION`).toString() === extension.packageInfo.version) {
  - return
  + resolve()
  }
  fs.writeFileSync(`${extensionPath}${path.sep}VERSION`, extension.packageInfo.version)
  const configuration = vscode.workspace.getConfiguration('latex-workshop')
  if (!(configuration.get('message.update.show') as boolean)) {
  - return
  + resolve()
  }
  vscode.window.showInformationMessage(`LaTeX Workshop updated to version ${extension.packageInfo.version}.`,
  'Change log', 'Star the project', 'Disable this message')
  @@ -177,6 +178,7 @@ function newVersionMessage(extensionPath: string, extension: Extension) {
  }
  })
  })
  + })
  }
  export async function activate(context: vscode.ExtensionContext) {
  @@ -347,7 +349,7 @@ export async function activate(context: vscode.ExtensionContext) {
  obsoleteConfigCheck(extension)
  conflictExtensionCheck()
  checkDeprecatedFeatures(extension)
  - newVersionMessage(context.extensionPath, extension)
  + await newVersionMessage(context.extensionPath, extension)
  vscode.window.visibleTextEditors.forEach(editor => {
  const e = editor.document
  