From 768747a55edec2f12e0054be5414d95aa256d2b3 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 5 Dec 2022 16:29:18 +0300 Subject: [PATCH] Update suggestion argument doc (#3948) Updated the doc to match the implemented API. --- docs/language-server/protocol-language-server.md | 12 +++++++----- .../main/scala/org/enso/polyglot/Suggestion.scala | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/language-server/protocol-language-server.md b/docs/language-server/protocol-language-server.md index 173709c7d9..e98648d069 100644 --- a/docs/language-server/protocol-language-server.md +++ b/docs/language-server/protocol-language-server.md @@ -428,16 +428,18 @@ The argument of a [`SuggestionEntry`](#suggestionentry). ```typescript // The argument of a constructor, method or function suggestion. interface SuggestionEntryArgument { - // The argument name + /** The argument name. */ 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; - // Indicates whether the argument is lazy + /** Indicates whether the argument is lazy. */ isSuspended: bool; - // Indicates whether the argument has default value + /** Indicates whether the argument has default value. */ hasDefault: bool; - // Optional default value + /** Optional default value. */ defaultValue?: string; + /** Optional list of possible values that this argument takes. */ + tagValues?: string[]; } ``` diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala index 13b74173f5..f80e57f8a1 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala @@ -142,6 +142,7 @@ object Suggestion { * @param isSuspended is the argument lazy * @param hasDefault does the argument have a default * @param defaultValue optional default value + * @param tagValues optional list of possible values */ case class Argument( name: String, @@ -160,6 +161,8 @@ object Suggestion { s"isSuspended=$isSuspended," + s"hasDefault=$hasDefault,defaultValue=" + (if (shouldMask) defaultValue.map(_ => STUB) else defaultValue) + + s",tagValues=" + + (if (shouldMask) tagValues.map(_ => STUB) else tagValues) + ")" }