By default, Ghostdoc does not attempt to provide any text for return types. However, you can set up a rule to do it, as suggested in the link in the question.
For example, to set a rule that adds a return description to any method with a name starting 'Get...' and using the rest of the method name for the text (as suggested in the question):
- In Visual Studio, go to Tools > Ghostdoc > Options
- Select
Rules
under GhostDoc
in the tree
- Select the
Methods
'folder' in the right-hand Rules list (you may need to scroll the list)
Add a new rule to match methods starting with 'Get...':
- Click
Add...
and OK
to add a new 'Custom match' rule
- Change the name to something like:
Match 'Get' methods
- Click the
<any>
link after method name
to set the condition
Select starts with
, type
Get
followed by a space, in the text box and click OK
Now, to set the 'returns' template text:
- In the grid, click the ellipsis button
...
next to <returns>
Type
The
followed by a space, in the 'Template text' box
- Expand
MethodName
> Words
, select ExceptFirst
, click Insert
and OK
The default summary text is overridden by the new rule, so to add something sensible for our new rule:
- Back in the grid, click the
...
button next to <summary>
Type
Gets the
followed by a space, in the Template text box
- Expand
MethodName
> Words
, select ExceptFirst
, click Insert
and OK
- Click
OK
to complete the setting up of the rule
Ensure the rule is positioned below the existing int GetHashCode()
rule so that the latter one will take precedence in that special case. Click OK to close the Options dialog and you're ready to try out the new rule.