From 2e2fd24a011f4782bae6e364c07d29ce6efbd252 Mon Sep 17 00:00:00 2001 From: dawe Date: Sun, 18 Aug 2024 18:39:44 +0200 Subject: [PATCH] try to improve the signature of a constructor call if the symbol only gives us "unit" as a return type (#1312) --- src/FsAutoComplete.Core/SignatureFormatter.fs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FsAutoComplete.Core/SignatureFormatter.fs b/src/FsAutoComplete.Core/SignatureFormatter.fs index 4609388aa..a1b7bba00 100644 --- a/src/FsAutoComplete.Core/SignatureFormatter.fs +++ b/src/FsAutoComplete.Core/SignatureFormatter.fs @@ -314,8 +314,11 @@ module SignatureFormatter = retType //A ctor with () parameters seems to be a list with an empty list. // Also abstract members and abstract member overrides with one () parameter seem to be a list with an empty list. - elif func.IsConstructor || (func.IsMember && (not func.IsPropertyGetterMethod)) then - modifiers + ": unit -> " ++ retType + elif func.IsConstructor then + let retType = if retType = "unit" then func.DisplayNameCore else retType + modifiers + ": unit ->" ++ retType + elif func.IsMember && (not func.IsPropertyGetterMethod) then + modifiers + ": unit ->" ++ retType else modifiers ++ functionName + ":" ++ retType //Value members seems to be a list with an empty list | [ [ p ] ] when maybeGetter && formatParameter p = "unit" -> //Member or property with only getter