From 5a2d6adbea9057b559dd2a06a6ec959ce30fafb7 Mon Sep 17 00:00:00 2001 From: Janos Wortmann Date: Tue, 28 May 2024 21:46:59 +0200 Subject: [PATCH] Fix CodeActionTriggerKind enum access --- 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