From 46171f611a8963fa5499cb437e641c8cfce68449 Mon Sep 17 00:00:00 2001 From: jwortmann Date: Wed, 29 May 2024 18:58:33 +0200 Subject: [PATCH] Fix CodeActionTriggerKind enum access (#2484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Предраг Николић --- plugin/core/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/core/views.py b/plugin/core/views.py index 3a6e8e8d1..b5374eeff 100644 --- a/plugin/core/views.py +++ b/plugin/core/views.py @@ -403,9 +403,10 @@ def text_document_code_action_params( only_kinds: list[CodeActionKind] | None = None, manual: bool = False ) -> CodeActionParams: + trigger_kind = CodeActionTriggerKind.Invoked.value if manual else CodeActionTriggerKind.Automatic.value context: CodeActionContext = { "diagnostics": diagnostics, - "triggerKind": CodeActionTriggerKind.Invoked if manual else CodeActionTriggerKind.Automatic, + "triggerKind": cast(CodeActionTriggerKind, trigger_kind), } if only_kinds: context["only"] = only_kinds