Skip to content

Commit

Permalink
try to improve the signature of a constructor call if the symbol only…
Browse files Browse the repository at this point in the history
… gives us "unit" as a return type (#1312)
  • Loading branch information
dawedawe authored Aug 18, 2024
1 parent fc79e99 commit 2e2fd24
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/FsAutoComplete.Core/SignatureFormatter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e2fd24

Please sign in to comment.