From 1f1c230456cd905c8fbf7f2472d5194d908f53fc Mon Sep 17 00:00:00 2001 From: chemzqm Date: Mon, 17 Dec 2018 22:17:23 +0800 Subject: [PATCH] fix registerCodeActionProvider with CodeActionKind --- src/server/languageProvider.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/languageProvider.ts b/src/server/languageProvider.ts index 0179b23..0c34d91 100644 --- a/src/server/languageProvider.ts +++ b/src/server/languageProvider.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Diagnostic, Disposable } from 'vscode-languageserver-protocol' +import { Diagnostic, Disposable, CodeActionKind } from 'vscode-languageserver-protocol' import Uri from 'vscode-uri' import { workspace, commands, events, languages, DiagnosticKind, ServiceStat, disposeAll } from 'coc.nvim' import { CachedNavTreeResponse } from './features/baseCodeLensProvider' @@ -234,14 +234,16 @@ export default class LanguageProvider { languages.registerCodeActionProvider( languageIds, new RefactorProvider(client, this.fileConfigurationManager), - 'tsserver')) + 'tsserver', + [CodeActionKind.Refactor])) } this.disposables.push( languages.registerCodeActionProvider( languageIds, new QuickfixProvider(client, this.diagnosticsManager, this.bufferSyncSupport), - 'tsserver')) + 'tsserver', + [CodeActionKind.QuickFix])) let cachedResponse = new CachedNavTreeResponse() if (this.client.apiVersion.gte(API.v206) && conf.get('referencesCodeLens.enable')) {