From 68ab808e6a4d6fda800ae47948112c42af1f7967 Mon Sep 17 00:00:00 2001 From: DimitarVen Date: Fri, 18 Oct 2024 14:08:02 +0300 Subject: [PATCH] implement description lazy loading --- .../PythonNodeModelsWpf/IronPythonCompletionData.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Libraries/PythonNodeModelsWpf/IronPythonCompletionData.cs b/src/Libraries/PythonNodeModelsWpf/IronPythonCompletionData.cs index 3e1cc61d3b1..de4bd1da4c4 100644 --- a/src/Libraries/PythonNodeModelsWpf/IronPythonCompletionData.cs +++ b/src/Libraries/PythonNodeModelsWpf/IronPythonCompletionData.cs @@ -49,17 +49,17 @@ internal static CompletionType ConvertCompletionType(ExternalCodeCompletionType internal IronPythonCompletionData(IExternalCodeCompletionData data) { - this.Text = data.Text; - this.Description = data.Description; + Text = data.Text; BuildCompletionTypeToIconMap(); Image = TypeToIcon[ConvertCompletionType(data.CompletionType)]; + description = new Lazy(() => data.Description); } public System.Windows.Media.ImageSource Image { get; } - + public string Text { get; private set; } public string Stub { get; private set; } @@ -72,7 +72,8 @@ public object Content get { return Text; } } - public object Description { get; private set; } + private readonly Lazy description = null; + public object Description => description?.Value ?? ""; public double Priority { get { return 0; } }