From 257611ec4331103ca5d2d17914226727ec9f8d61 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Tue, 19 May 2020 10:02:57 -0700 Subject: [PATCH] Show tooltip for comparison operators --- .../Services/TextDocument/Handlers/CompletionHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs b/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs index f49a18695..f01073733 100644 --- a/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs +++ b/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs @@ -266,6 +266,12 @@ private static CompletionItem CreateCompletionItem( { detailString = matches[0].Groups[1].Value; } + // The comparison operators (-eq, -not, -gt, etc) are unfortunately fall into ParameterName + // but they don't have a type associated to them. This allows those tooltips to show up. + else if (!string.IsNullOrEmpty(completionDetails.ToolTipText)) + { + detailString = completionDetails.ToolTipText; + } break; case CompletionType.Command: // For Commands, let's extract the resolved command or the path for an exe