message: Better WebSocket reconnect variable names
diff: @@ -409,23 +409,26 @@ class LateXWorkshopPdfViewer implements ILatexWorkshopPdfViewer {
  // Since WebSockets are disconnected when PC resumes from sleep,
  // we have to reconnect. https://github.com/James-Yu/LaTeX-Workshop/pull/1812
  - const reconnect = (i: number) => async () => {
  - console.log('Try to reconnect to LaTeX Workshop.')
  - this.connectionPort = createConnectionPort(this)
  + const reconnect = (tries: number) => async () => {
  + console.log(`Try to reconnect to LaTeX Workshop: (${tries}/10).`)
  try {
  - await this.connectionPort.onDidOpen(() => {
  + this.connectionPort = createConnectionPort(this)
  + this.connectionPort.onDidOpen(() => {
  document.title = this.documentTitle
  this.setupConnectionPort()
  - console.log('Reconnected: WebScocket to LaTeX Workshop.')
  + console.log('Reconnected: WebSocket to LaTeX Workshop.')
  })
  }
  catch {
  - if (i <= 10) {
  - setTimeout(reconnect(i+1), 1000*(2+(i)))
  + if (tries <= 10) {
  + tries++
  + setTimeout(reconnect(tries), 1000 * (tries + 2))
  + } else {
  + console.log('Cannot reconnect to LaTeX Workshop.')
  }
  }
  }
  - setTimeout(reconnect(2), 3000)
  + setTimeout(reconnect(1), 3000)
  })
  }
  