From b530f9ee6f1bc87cf42e8e1d2edcda1a3884fc1d Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Fri, 20 Aug 2021 18:24:45 +0800 Subject: [PATCH] use diagnosticManager from tsserver client --- src/server/commands.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/commands.ts b/src/server/commands.ts index 23a7911..6d99712 100644 --- a/src/server/commands.ts +++ b/src/server/commands.ts @@ -1,4 +1,4 @@ -import { commands, diagnosticManager, CancellationToken, Diagnostic, Disposable, ServiceStat, Uri as URI, window, workspace } from 'coc.nvim' +import { commands, CancellationToken, Diagnostic, Disposable, ServiceStat, Uri as URI, window, workspace } from 'coc.nvim' import { Location, Position, Range, TextEdit } from 'vscode-languageserver-types' import TsserverService from '../server' import { PluginManager } from '../utils/plugins' @@ -110,8 +110,7 @@ export class AutoFixCommand implements Command { return } let file = client.serviceClient.toPath(document.uri) - let collectionDiags = diagnosticManager.getDiagnostics(document.uri) - let diagnostics = Array.isArray(collectionDiags) ? collectionDiags as Diagnostic[] : collectionDiags[this.service.id] + let diagnostics = client.serviceClient.diagnosticsManager.getDiagnostics(document.uri) let missingDiagnostics = diagnostics.filter(o => o.code == 2307) if (missingDiagnostics.length) { let names = missingDiagnostics.map(o => {