Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the signature of a constructor call if the symbol only gives us "unit" #1312

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading