From 8ddd73503a35d5852950a5fdbf9f8a452c90141f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nyikos=20Zolt=C3=A1n?= Date: Fri, 27 Dec 2024 14:38:41 +0100 Subject: [PATCH] fix inlay hints with lambda expressions when the type cannot be determined for a lambda expression the InlayHint will be generated with a null `label` which is not valid per spec and is causing an error in neovim --- src/server.vala | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server.vala b/src/server.vala index 02fcce6e..fca594ad 100644 --- a/src/server.vala +++ b/src/server.vala @@ -2201,12 +2201,14 @@ class Vls.Server : Jsonrpc.Server { var lambda = (Vala.LambdaExpression)item; foreach (var param in lambda.get_parameters ()) { var range = new Range.from_sourceref (param.source_reference); - hints += new InlayHint () { - position = range.start, - label = CodeHelp.get_data_type_representation (param.variable_type, null), - kind = InlayHintKind.PARAMETER, - paddingRight = true - }; + if (param.variable_type != null) { + hints += new InlayHint () { + position = range.start, + label = CodeHelp.get_data_type_representation (param.variable_type, null), + kind = InlayHintKind.PARAMETER, + paddingRight = true + }; + } } } else if ((item is Vala.MethodCall || item is Vala.ObjectCreationExpression) && compilation.method_calls.has_key (item)) { Vala.List? parameters = null;