Update suggestion argument doc (#3948)

Updated the doc to match the implemented API.
This commit is contained in:
Dmitry Bushev 2022-12-05 16:29:18 +03:00 committed by GitHub
parent a24dfe6adb
commit 768747a55e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -428,16 +428,18 @@ The argument of a [`SuggestionEntry`](#suggestionentry).
```typescript ```typescript
// The argument of a constructor, method or function suggestion. // The argument of a constructor, method or function suggestion.
interface SuggestionEntryArgument { interface SuggestionEntryArgument {
// The argument name /** The argument name. */
name: string; name: string;
// The argument type. String 'Any' is used to specify generic types /** The argument type. String 'Any' is used to specify generic types. */
type: string; type: string;
// Indicates whether the argument is lazy /** Indicates whether the argument is lazy. */
isSuspended: bool; isSuspended: bool;
// Indicates whether the argument has default value /** Indicates whether the argument has default value. */
hasDefault: bool; hasDefault: bool;
// Optional default value /** Optional default value. */
defaultValue?: string; defaultValue?: string;
/** Optional list of possible values that this argument takes. */
tagValues?: string[];
} }
``` ```

View File

@ -142,6 +142,7 @@ object Suggestion {
* @param isSuspended is the argument lazy * @param isSuspended is the argument lazy
* @param hasDefault does the argument have a default * @param hasDefault does the argument have a default
* @param defaultValue optional default value * @param defaultValue optional default value
* @param tagValues optional list of possible values
*/ */
case class Argument( case class Argument(
name: String, name: String,
@ -160,6 +161,8 @@ object Suggestion {
s"isSuspended=$isSuspended," + s"isSuspended=$isSuspended," +
s"hasDefault=$hasDefault,defaultValue=" + s"hasDefault=$hasDefault,defaultValue=" +
(if (shouldMask) defaultValue.map(_ => STUB) else defaultValue) + (if (shouldMask) defaultValue.map(_ => STUB) else defaultValue) +
s",tagValues=" +
(if (shouldMask) tagValues.map(_ => STUB) else tagValues) +
")" ")"
} }