Move watchers to cacher

This commit is contained in:
James-Yu 2023-01-06 15:26:29 +08:00
parent 6fa467d6b4
commit 1975d66bc3
9 changed files with 154 additions and 176 deletions

View File

@ -126,7 +126,7 @@ export class Builder {
this.lastBuild = Date.now() this.lastBuild = Date.now()
if (rootFile) { if (rootFile) {
this.extension.manager.ignorePdfFile(rootFile) this.extension.cacher.ignorePdfFile(rootFile)
} }
await vscode.workspace.saveAll() await vscode.workspace.saveAll()
@ -162,7 +162,7 @@ export class Builder {
// Stop watching the PDF file to avoid reloading the PDF viewer twice. // Stop watching the PDF file to avoid reloading the PDF viewer twice.
// The builder will be responsible for refreshing the viewer. // The builder will be responsible for refreshing the viewer.
this.extension.manager.ignorePdfFile(rootFile) this.extension.cacher.ignorePdfFile(rootFile)
await vscode.workspace.saveAll() await vscode.workspace.saveAll()

View File

@ -1,7 +1,6 @@
import * as vscode from 'vscode' import * as vscode from 'vscode'
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import * as chokidar from 'chokidar'
import { latexParser } from 'latex-utensils' import { latexParser } from 'latex-utensils'
import type { CmdEnvSuggestion } from '../providers/completer/completerutils' import type { CmdEnvSuggestion } from '../providers/completer/completerutils'
@ -15,6 +14,9 @@ import * as utils from '../utils/utils'
import { InputFileRegExp } from '../utils/inputfilepath' import { InputFileRegExp } from '../utils/inputfilepath'
import { canContext, isExcluded, parseFlsContent } from './cacherlib/cacherutils' import { canContext, isExcluded, parseFlsContent } from './cacherlib/cacherutils'
import { PathUtils } from './cacherlib/pathutils' import { PathUtils } from './cacherlib/pathutils'
import { Watcher } from './cacherlib/texwatcher'
import { PdfWatcher } from './cacherlib/pdfwatcher'
import { BibWatcher } from './cacherlib/bibwatcher'
export interface Context { export interface Context {
/** /**
@ -55,10 +57,11 @@ export interface Context {
export class Cacher { export class Cacher {
private readonly contexts: {[filePath: string]: Context} = {} private readonly contexts: {[filePath: string]: Context} = {}
private readonly watcher: Watcher = new Watcher(this.extension, this) private readonly watcher: Watcher = new Watcher(this.extension, this)
private readonly pdfWatcher: PdfWatcher = new PdfWatcher(this.extension)
private readonly bibWatcher: BibWatcher = new BibWatcher(this.extension)
private readonly pathUtils: PathUtils = new PathUtils(this.extension) private readonly pathUtils: PathUtils = new PathUtils(this.extension)
constructor(private readonly extension: Extension) { constructor(private readonly extension: Extension) {}
}
add(filePath: string) { add(filePath: string) {
if (isExcluded(filePath)) { if (isExcluded(filePath)) {
@ -85,6 +88,8 @@ export class Cacher {
async dispose() { async dispose() {
await this.watcher.watcher.close() await this.watcher.watcher.close()
await this.pdfWatcher.dispose()
await this.bibWatcher.dispose()
} }
async refreshContext(filePath: string, rootPath?: string) { async refreshContext(filePath: string, rootPath?: string) {
@ -183,7 +188,7 @@ export class Cacher {
} }
this.contexts[filePath].bibfiles.push(bibPath) this.contexts[filePath].bibfiles.push(bibPath)
this.extension.logger.addLogMessage(`[Cacher] Bib ${bibPath} from ${filePath}.`) this.extension.logger.addLogMessage(`[Cacher] Bib ${bibPath} from ${filePath}.`)
await this.extension.manager.bibWatcher.watchBibFile(bibPath) await this.bibWatcher.watchBibFile(bibPath)
} }
} }
this.extension.logger.addLogMessage(`[Cacher] Updated bibs of ${filePath}.`) this.extension.logger.addLogMessage(`[Cacher] Updated bibs of ${filePath}.`)
@ -311,7 +316,7 @@ export class Cacher {
if (rootFile && !this.getCachedContent(rootFile).bibfiles.includes(bibPath)) { if (rootFile && !this.getCachedContent(rootFile).bibfiles.includes(bibPath)) {
this.getCachedContent(rootFile).bibfiles.push(bibPath) this.getCachedContent(rootFile).bibfiles.push(bibPath)
} }
await this.extension.manager.bibWatcher.watchBibFile(bibPath) await this.bibWatcher.watchBibFile(bibPath)
} }
} }
} }
@ -433,103 +438,14 @@ export class Cacher {
}) })
return children return children
} }
}
class Watcher { ignorePdfFile(rootFile: string) {
readonly watcher: chokidar.FSWatcher const pdfFilePath = this.extension.manager.tex2pdf(rootFile)
readonly watched: Set<string> = new Set() const pdfFileUri = vscode.Uri.file(pdfFilePath)
this.pdfWatcher.ignorePdfFile(pdfFileUri)
constructor(
private readonly extension: Extension,
private readonly cacher: Cacher
) {
const configuration = vscode.workspace.getConfiguration('latex-workshop')
const watcherOption = {
useFsEvents: false,
usePolling: configuration.get('latex.watch.usePolling') as boolean,
interval: configuration.get('latex.watch.interval') as number,
binaryInterval: Math.max(configuration.get('latex.watch.interval') as number, 1000),
awaitWriteFinish: {stabilityThreshold: configuration.get('latex.watch.delay') as number}
}
this.extension.logger.addLogMessage(`[Cacher][Watcher]Create watcher: ${JSON.stringify(watcherOption)}`)
this.watcher = chokidar.watch([], watcherOption)
this.watcher.on('add', (file: string) => this.onAdd(file))
this.watcher.on('change', (file: string) => this.onChange(file))
this.watcher.on('unlink', (file: string) => this.onUnlink(file))
this.registerOptionReload()
} }
add(filePath: string) { watchPdfFile(pdfFileUri: vscode.Uri) {
this.watcher.add(filePath) this.pdfWatcher.watchPdfFile(pdfFileUri)
this.watched.add(filePath)
}
has(filePath: string) {
return this.watched.has(filePath)
}
async reset() {
await this.watcher.close()
this.watched.clear()
this.watcher.on('add', (file: string) => this.onAdd(file))
this.watcher.on('change', (file: string) => this.onChange(file))
this.watcher.on('unlink', (file: string) => this.onUnlink(file))
}
private onAdd(filePath: string) {
this.extension.logger.addLogMessage(`[Cacher][Watcher] Watched ${filePath}.`)
this.extension.eventBus.fire(eventbus.FileWatched, filePath)
}
private onChange(filePath: string) {
if (canContext(filePath)) {
void this.cacher.refreshContext(filePath)
}
void this.extension.builder.buildOnFileChanged(filePath)
this.extension.logger.addLogMessage(`[Cacher][Watcher] Changed ${filePath}.`)
this.extension.eventBus.fire(eventbus.FileChanged, filePath)
}
private onUnlink(filePath: string) {
this.watcher.unwatch(filePath)
this.watched.delete(filePath)
this.cacher.removeCachedContent(filePath)
if (filePath === this.extension.manager.rootFile) {
this.extension.logger.addLogMessage(`[Cacher][Watcher] Root deleted ${filePath}.`)
this.extension.manager.rootFile = undefined
void this.extension.manager.findRoot()
} else {
this.extension.logger.addLogMessage(`[Cacher][Watcher] Deleted ${filePath}.`)
}
this.extension.eventBus.fire(eventbus.FileRemoved, filePath)
}
private registerOptionReload() {
this.extension.context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
const configuration = vscode.workspace.getConfiguration('latex-workshop')
if (e.affectsConfiguration('latex-workshop.latex.watch.usePolling') ||
e.affectsConfiguration('latex-workshop.latex.watch.interval') ||
e.affectsConfiguration('latex-workshop.latex.watch.delay') ||
e.affectsConfiguration('latex-workshop.latex.watch.pdf.delay')) {
this.watcher.options.usePolling = configuration.get('latex.watch.usePolling') as boolean
this.watcher.options.interval = configuration.get('latex.watch.interval') as number
this.watcher.options.awaitWriteFinish = {stabilityThreshold: configuration.get('latex.watch.delay') as number}
}
if (e.affectsConfiguration('latex-workshop.latex.watch.files.ignore')) {
this.watched.forEach(filePath => {
if (!isExcluded(filePath)) {
return
}
this.watcher.unwatch(filePath)
this.watched.delete(filePath)
this.cacher.removeCachedContent(filePath)
this.extension.logger.addLogMessage(`[Cacher][Watcher] Ignored ${filePath}.`)
void this.extension.manager.findRoot()
})
}
}))
} }
} }

View File

@ -11,6 +11,14 @@ export class BibWatcher {
constructor(extension: Extension) { constructor(extension: Extension) {
this.extension = extension this.extension = extension
this.bibWatcher = this.initiateBibwatcher() this.bibWatcher = this.initiateBibwatcher()
this.extension.context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
if (e.affectsConfiguration('latex-workshop.latex.watch.usePolling') ||
e.affectsConfiguration('latex-workshop.latex.watch.interval') ||
e.affectsConfiguration('latex-workshop.latex.watch.delay')) {
this.updateWatcherOptions()
}
}))
} }
async dispose() { async dispose() {
@ -18,27 +26,20 @@ export class BibWatcher {
} }
initiateBibwatcher() { initiateBibwatcher() {
const configuration = vscode.workspace.getConfiguration('latex-workshop')
const usePolling = configuration.get('latex.watch.usePolling') as boolean
const interval = configuration.get('latex.watch.interval') as number
const delay = configuration.get('latex.watch.delay') as number
const watcherOptions = {
useFsEvents: false,
usePolling,
interval,
binaryInterval: Math.max(interval, 1000),
awaitWriteFinish: {stabilityThreshold: delay}
}
this.extension.logger.addLogMessage('Creating Bib file watcher.') this.extension.logger.addLogMessage('Creating Bib file watcher.')
this.extension.logger.addLogMessage(`watcherOptions: ${JSON.stringify(watcherOptions)}`) const bibWatcher = chokidar.watch([], {useFsEvents: false})
const bibWatcher = chokidar.watch([], watcherOptions) this.updateWatcherOptions()
bibWatcher.on('change', (file: string) => this.onWatchedBibChanged(file)) bibWatcher.on('change', (file: string) => this.onWatchedBibChanged(file))
bibWatcher.on('unlink', (file: string) => this.onWatchedBibDeleted(file)) bibWatcher.on('unlink', (file: string) => this.onWatchedBibDeleted(file))
return bibWatcher return bibWatcher
} }
updateWatcherOptions() { private updateWatcherOptions() {
this.extension.manager.updateWatcherOptions(this.bibWatcher) const configuration = vscode.workspace.getConfiguration('latex-workshop')
this.bibWatcher.options.usePolling = configuration.get('latex.watch.usePolling') as boolean
this.bibWatcher.options.interval = configuration.get('latex.watch.interval') as number
this.bibWatcher.options.binaryInterval = Math.max(configuration.get('latex.watch.interval') as number, 1000)
this.bibWatcher.options.awaitWriteFinish = {stabilityThreshold: configuration.get('latex.watch.delay') as number}
} }
private async onWatchedBibChanged(file: string) { private async onWatchedBibChanged(file: string) {

View File

@ -14,6 +14,14 @@ export class PdfWatcher {
this.extension = extension this.extension = extension
this.pdfWatcher = this.initiatePdfWatcher() this.pdfWatcher = this.initiatePdfWatcher()
this.initiateVirtualUriWatcher() this.initiateVirtualUriWatcher()
this.extension.context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
if (e.affectsConfiguration('latex-workshop.latex.watch.usePolling') ||
e.affectsConfiguration('latex-workshop.latex.watch.interval') ||
e.affectsConfiguration('latex-workshop.latex.watch.pdf.delay')) {
this.updateWatcherOptions()
}
}))
} }
async dispose() { async dispose() {
@ -25,27 +33,20 @@ export class PdfWatcher {
} }
private initiatePdfWatcher() { private initiatePdfWatcher() {
const configuration = vscode.workspace.getConfiguration('latex-workshop')
const usePolling = configuration.get('latex.watch.usePolling') as boolean
const interval = configuration.get('latex.watch.interval') as number
const pdfDelay = configuration.get('latex.watch.pdf.delay') as number
const pdfWatcherOptions = {
useFsEvents: false,
usePolling,
interval,
binaryInterval: Math.max(interval, 1000),
awaitWriteFinish: {stabilityThreshold: pdfDelay}
}
this.extension.logger.addLogMessage('Creating PDF file watcher.') this.extension.logger.addLogMessage('Creating PDF file watcher.')
this.extension.logger.addLogMessage(`watcherOptions: ${JSON.stringify(pdfWatcherOptions)}`) const pdfWatcher = chokidar.watch([], {useFsEvents: false})
const pdfWatcher = chokidar.watch([], pdfWatcherOptions) this.updateWatcherOptions()
pdfWatcher.on('change', (file: string) => this.onWatchedPdfChanged(file)) pdfWatcher.on('change', (file: string) => this.onWatchedPdfChanged(file))
pdfWatcher.on('unlink', (file: string) => this.onWatchedPdfDeleted(file)) pdfWatcher.on('unlink', (file: string) => this.onWatchedPdfDeleted(file))
return pdfWatcher return pdfWatcher
} }
updateWatcherOptions() { private updateWatcherOptions() {
this.extension.manager.updateWatcherOptions(this.pdfWatcher, true) const configuration = vscode.workspace.getConfiguration('latex-workshop')
this.pdfWatcher.options.usePolling = configuration.get('latex.watch.usePolling') as boolean
this.pdfWatcher.options.interval = configuration.get('latex.watch.interval') as number
this.pdfWatcher.options.binaryInterval = Math.max(configuration.get('latex.watch.interval') as number, 1000)
this.pdfWatcher.options.awaitWriteFinish = {stabilityThreshold: configuration.get('latex.watch.pdf.delay')}
} }
private isWatchedVirtualUri(pdfFile: vscode.Uri): boolean { private isWatchedVirtualUri(pdfFile: vscode.Uri): boolean {

View File

@ -0,0 +1,102 @@
import * as vscode from 'vscode'
import * as chokidar from 'chokidar'
import { Extension } from '../../main'
import * as eventbus from '../eventbus'
import { Cacher } from '../cacher'
import { canContext, isExcluded } from './cacherutils'
export class Watcher {
readonly watcher: chokidar.FSWatcher
readonly watched: Set<string> = new Set()
constructor(
private readonly extension: Extension,
private readonly cacher: Cacher
) {
this.watcher = chokidar.watch([], {useFsEvents: false})
this.updateWatcherOptions()
this.watcher.on('add', (file: string) => this.onAdd(file))
this.watcher.on('change', (file: string) => this.onChange(file))
this.watcher.on('unlink', (file: string) => this.onUnlink(file))
this.registerOptionReload()
}
private updateWatcherOptions() {
const configuration = vscode.workspace.getConfiguration('latex-workshop')
this.watcher.options.usePolling = configuration.get('latex.watch.usePolling') as boolean
this.watcher.options.interval = configuration.get('latex.watch.interval') as number
this.watcher.options.binaryInterval = Math.max(configuration.get('latex.watch.interval') as number, 1000)
this.watcher.options.awaitWriteFinish = {stabilityThreshold: configuration.get('latex.watch.delay') as number}
}
add(filePath: string) {
this.watcher.add(filePath)
this.watched.add(filePath)
}
has(filePath: string) {
return this.watched.has(filePath)
}
async reset() {
await this.watcher.close()
this.watched.clear()
this.watcher.on('add', (file: string) => this.onAdd(file))
this.watcher.on('change', (file: string) => this.onChange(file))
this.watcher.on('unlink', (file: string) => this.onUnlink(file))
}
private onAdd(filePath: string) {
this.extension.logger.addLogMessage(`[Cacher][Watcher] Watched ${filePath}.`)
this.extension.eventBus.fire(eventbus.FileWatched, filePath)
}
private onChange(filePath: string) {
if (canContext(filePath)) {
void this.cacher.refreshContext(filePath)
}
void this.extension.builder.buildOnFileChanged(filePath)
this.extension.logger.addLogMessage(`[Cacher][Watcher] Changed ${filePath}.`)
this.extension.eventBus.fire(eventbus.FileChanged, filePath)
}
private onUnlink(filePath: string) {
this.watcher.unwatch(filePath)
this.watched.delete(filePath)
this.cacher.removeCachedContent(filePath)
if (filePath === this.extension.manager.rootFile) {
this.extension.logger.addLogMessage(`[Cacher][Watcher] Root deleted ${filePath}.`)
this.extension.manager.rootFile = undefined
void this.extension.manager.findRoot()
} else {
this.extension.logger.addLogMessage(`[Cacher][Watcher] Deleted ${filePath}.`)
}
this.extension.eventBus.fire(eventbus.FileRemoved, filePath)
}
private registerOptionReload() {
this.extension.context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
if (e.affectsConfiguration('latex-workshop.latex.watch.usePolling') ||
e.affectsConfiguration('latex-workshop.latex.watch.interval') ||
e.affectsConfiguration('latex-workshop.latex.watch.delay')) {
this.updateWatcherOptions()
}
if (e.affectsConfiguration('latex-workshop.latex.watch.files.ignore')) {
this.watched.forEach(filePath => {
if (!isExcluded(filePath)) {
return
}
this.watcher.unwatch(filePath)
this.watched.delete(filePath)
this.cacher.removeCachedContent(filePath)
this.extension.logger.addLogMessage(`[Cacher][Watcher] Ignored ${filePath}.`)
void this.extension.manager.findRoot()
})
}
}))
}
}

View File

@ -3,15 +3,12 @@ import * as os from 'os'
import * as path from 'path' import * as path from 'path'
import * as fs from 'fs' import * as fs from 'fs'
import * as tmp from 'tmp' import * as tmp from 'tmp'
import * as chokidar from 'chokidar'
import * as utils from '../utils/utils' import * as utils from '../utils/utils'
// import {InputFileRegExp} from '../utils/inputfilepath' // import {InputFileRegExp} from '../utils/inputfilepath'
import type {Extension} from '../main' import type {Extension} from '../main'
import * as eventbus from './eventbus' import * as eventbus from './eventbus'
import {PdfWatcher} from './managerlib/pdfwatcher'
import {BibWatcher} from './managerlib/bibwatcher'
import {FinderUtils} from './managerlib/finderutils' import {FinderUtils} from './managerlib/finderutils'
import {IntellisenseWatcher} from './managerlib/intellisensewatcher' import {IntellisenseWatcher} from './managerlib/intellisensewatcher'
@ -30,8 +27,6 @@ export class Manager {
readonly tmpDir: string readonly tmpDir: string
private readonly extension: Extension private readonly extension: Extension
private readonly pdfWatcher: PdfWatcher
readonly bibWatcher: BibWatcher
readonly intellisenseWatcher: IntellisenseWatcher readonly intellisenseWatcher: IntellisenseWatcher
private readonly finderUtils: FinderUtils private readonly finderUtils: FinderUtils
private readonly rsweaveExt: string[] = ['.rnw', '.Rnw', '.rtex', '.Rtex', '.snw', '.Snw'] private readonly rsweaveExt: string[] = ['.rnw', '.Rnw', '.rtex', '.Rtex', '.snw', '.Snw']
@ -39,23 +34,10 @@ export class Manager {
constructor(extension: Extension) { constructor(extension: Extension) {
this.extension = extension this.extension = extension
this.pdfWatcher = new PdfWatcher(extension)
this.bibWatcher = new BibWatcher(extension)
this.intellisenseWatcher = new IntellisenseWatcher() this.intellisenseWatcher = new IntellisenseWatcher()
this.finderUtils = new FinderUtils(extension) this.finderUtils = new FinderUtils(extension)
this.registerSetEnvVar() this.registerSetEnvVar()
this.extension.context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
if (e.affectsConfiguration('latex-workshop.latex.watch.usePolling') ||
e.affectsConfiguration('latex-workshop.latex.watch.interval') ||
e.affectsConfiguration('latex-workshop.latex.watch.delay') ||
e.affectsConfiguration('latex-workshop.latex.watch.pdf.delay')) {
// this.updateWatcherOptions(this.fileWatcher)
this.bibWatcher.updateWatcherOptions()
this.pdfWatcher.updateWatcherOptions()
}
}))
// Create temp folder // Create temp folder
try { try {
this.tmpDir = tmp.dirSync({unsafeCleanup: true}).name.split(path.sep).join('/') this.tmpDir = tmp.dirSync({unsafeCleanup: true}).name.split(path.sep).join('/')
@ -72,19 +54,6 @@ export class Manager {
} }
} }
updateWatcherOptions(watcher: chokidar.FSWatcher, pdf = false) {
const configuration = vscode.workspace.getConfiguration('latex-workshop')
watcher.options.usePolling = configuration.get('latex.watch.usePolling') as boolean
watcher.options.interval = configuration.get('latex.watch.interval') as number
watcher.options.awaitWriteFinish = {
stabilityThreshold: pdf ? configuration.get('latex.watch.pdf.delay') : configuration.get('latex.watch.delay') as number
}
}
async dispose() {
await this.pdfWatcher.dispose()
await this.bibWatcher.dispose()
}
/** /**
* Returns the output directory developed according to the input tex path * Returns the output directory developed according to the input tex path
* and 'latex.outDir' config. If `texPath` is `undefined`, the default root * and 'latex.outDir' config. If `texPath` is `undefined`, the default root
@ -223,12 +192,6 @@ export class Manager {
return path.resolve(path.dirname(texPath), outDir, path.basename(`${texPath.substring(0, texPath.lastIndexOf('.'))}.pdf`)) return path.resolve(path.dirname(texPath), outDir, path.basename(`${texPath.substring(0, texPath.lastIndexOf('.'))}.pdf`))
} }
ignorePdfFile(rootFile: string) {
const pdfFilePath = this.tex2pdf(rootFile)
const pdfFileUri = vscode.Uri.file(pdfFilePath)
this.pdfWatcher.ignorePdfFile(pdfFileUri)
}
/** /**
* Returns `true` if the language of `id` is one of supported languages. * Returns `true` if the language of `id` is one of supported languages.
* *
@ -407,10 +370,6 @@ export class Manager {
return this.intellisenseWatcher.onDidUpdateIntellisense(cb) return this.intellisenseWatcher.onDidUpdateIntellisense(cb)
} }
watchPdfFile(pdfFileUri: vscode.Uri) {
this.pdfWatcher.watchPdfFile(pdfFileUri)
}
private registerSetEnvVar() { private registerSetEnvVar() {
this.setEnvVar() this.setEnvVar()
const configName = 'latex-workshop.docker.image.latex' const configName = 'latex-workshop.docker.image.latex'

View File

@ -111,7 +111,7 @@ export class Viewer {
} }
const pdfFileUri = this.tex2pdf(sourceFile) const pdfFileUri = this.tex2pdf(sourceFile)
this.createClientSet(pdfFileUri) this.createClientSet(pdfFileUri)
this.extension.manager.watchPdfFile(pdfFileUri) this.extension.cacher.watchPdfFile(pdfFileUri)
try { try {
this.extension.logger.addLogMessage(`Serving PDF file at ${url}`) this.extension.logger.addLogMessage(`Serving PDF file at ${url}`)
await vscode.env.openExternal(vscode.Uri.parse(url, true)) await vscode.env.openExternal(vscode.Uri.parse(url, true))

View File

@ -58,7 +58,7 @@ export class PdfViewerManagerService {
initiatePdfViewerPanel(pdfPanel: PdfViewerPanel): PdfViewerPanel | undefined { initiatePdfViewerPanel(pdfPanel: PdfViewerPanel): PdfViewerPanel | undefined {
const pdfFileUri = pdfPanel.pdfFileUri const pdfFileUri = pdfPanel.pdfFileUri
this.extension.manager.watchPdfFile(pdfFileUri) this.extension.cacher.watchPdfFile(pdfFileUri)
this.createClientSet(pdfFileUri) this.createClientSet(pdfFileUri)
const panelSet = this.getPanelSet(pdfFileUri) const panelSet = this.getPanelSet(pdfFileUri)
if (!panelSet) { if (!panelSet) {

View File

@ -415,7 +415,6 @@ export class Extension {
async dispose() { async dispose() {
await this.cacher.dispose() await this.cacher.dispose()
await this.manager.dispose()
this.server.dispose() this.server.dispose()
await this.pegParser.dispose() await this.pegParser.dispose()
await this.mathPreview.dispose() await this.mathPreview.dispose()