use diagnosticManager from tsserver client
This commit is contained in:
parent
0e5132f041
commit
b530f9ee6f
1 changed files with 2 additions and 3 deletions
|
@ -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 { Location, Position, Range, TextEdit } from 'vscode-languageserver-types'
|
||||||
import TsserverService from '../server'
|
import TsserverService from '../server'
|
||||||
import { PluginManager } from '../utils/plugins'
|
import { PluginManager } from '../utils/plugins'
|
||||||
|
@ -110,8 +110,7 @@ export class AutoFixCommand implements Command {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let file = client.serviceClient.toPath(document.uri)
|
let file = client.serviceClient.toPath(document.uri)
|
||||||
let collectionDiags = diagnosticManager.getDiagnostics(document.uri)
|
let diagnostics = client.serviceClient.diagnosticsManager.getDiagnostics(document.uri)
|
||||||
let diagnostics = Array.isArray(collectionDiags) ? collectionDiags as Diagnostic[] : collectionDiags[this.service.id]
|
|
||||||
let missingDiagnostics = diagnostics.filter(o => o.code == 2307)
|
let missingDiagnostics = diagnostics.filter(o => o.code == 2307)
|
||||||
if (missingDiagnostics.length) {
|
if (missingDiagnostics.length) {
|
||||||
let names = missingDiagnostics.map(o => {
|
let names = missingDiagnostics.map(o => {
|
||||||
|
|
Loading…
Reference in a new issue