From 0e5132f041d60a182d63e2a34becd9bc62cfe2fb Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Fri, 20 Aug 2021 18:14:32 +0800 Subject: [PATCH] fix: getDiagnostics breaking changes (#307) --- package.json | 2 +- src/server/commands.ts | 3 ++- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0ff31ae..40a44e4 100644 --- a/package.json +++ b/package.json @@ -685,7 +685,7 @@ "license": "MIT", "devDependencies": { "@types/node": "^10.12.0", - "coc.nvim": "^0.0.81-next.5", + "coc.nvim": "^0.0.81-next.6", "esbuild": "^0.8.29", "semver": "^7.3.2", "vscode-languageserver-protocol": "^3.16.0", diff --git a/src/server/commands.ts b/src/server/commands.ts index 78dfef0..23a7911 100644 --- a/src/server/commands.ts +++ b/src/server/commands.ts @@ -110,7 +110,8 @@ export class AutoFixCommand implements Command { return } let file = client.serviceClient.toPath(document.uri) - let diagnostics = diagnosticManager.getDiagnostics(document.uri).slice() as Diagnostic[] + let collectionDiags = diagnosticManager.getDiagnostics(document.uri) + let diagnostics = Array.isArray(collectionDiags) ? collectionDiags as Diagnostic[] : collectionDiags[this.service.id] let missingDiagnostics = diagnostics.filter(o => o.code == 2307) if (missingDiagnostics.length) { let names = missingDiagnostics.map(o => { diff --git a/yarn.lock b/yarn.lock index 76a495a..a598ef9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.44.tgz#3945e6b702cb6403f22b779c8ea9e5c3f44ead40" integrity sha512-vHPAyBX1ffLcy4fQHmDyIUMUb42gHZjPHU66nhvbMzAWJqHnySGZ6STwN3rwrnSd1FHB0DI/RWgGELgKSYRDmw== -coc.nvim@^0.0.81-next.5: - version "0.0.81-next.5" - resolved "https://registry.yarnpkg.com/coc.nvim/-/coc.nvim-0.0.81-next.5.tgz#b09bda5a2d527f7cd7bd786d4dee958160285e2b" - integrity sha512-NUTEWmjm9uKGBD8FNsj55PH1Xn4hD5uDCs7EdMoBpXWehq6/P1UoDZQfWXQv9HTq4zF/jH3g7KtZtl94VTlW4A== +coc.nvim@^0.0.81-next.6: + version "0.0.81-next.6" + resolved "https://registry.yarnpkg.com/coc.nvim/-/coc.nvim-0.0.81-next.6.tgz#c3ee7079a66702ebb3b06d4c2bf333d9306ec561" + integrity sha512-VT+DhygyTIzu9IRrwCUljMzfNfh8TeXqqrvFsBE0E8cUwERgCAIvRbBMEDfqaaI+XFgyuwNRwbX5kEvfjG/u3g== esbuild@^0.8.29: version "0.8.29"