From 34ddd37301e242f8d73eec8d06f732561e30a9e0 Mon Sep 17 00:00:00 2001 From: AdRiley Date: Tue, 17 Dec 2024 13:19:07 +0000 Subject: [PATCH] Add Missing_Argument error to join right (#11888) --- app/gui/src/project-view/util/callTree.ts | 8 ++++++-- .../lib/Standard/Database/0.0.0-dev/src/DB_Table.enso | 3 ++- distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/gui/src/project-view/util/callTree.ts b/app/gui/src/project-view/util/callTree.ts index 5c34e4cf58..087ded4b91 100644 --- a/app/gui/src/project-view/util/callTree.ts +++ b/app/gui/src/project-view/util/callTree.ts @@ -4,7 +4,11 @@ import type { WidgetConfiguration } from '@/providers/widgetRegistry/configurati import * as widgetCfg from '@/providers/widgetRegistry/configuration' import { DisplayMode } from '@/providers/widgetRegistry/configuration' import type { MethodCallInfo } from '@/stores/graph/graphDatabase' -import type { SuggestionEntry, SuggestionEntryArgument } from '@/stores/suggestionDatabase/entry' +import { + isRequiredArgument, + type SuggestionEntry, + type SuggestionEntryArgument, +} from '@/stores/suggestionDatabase/entry' import { Ast } from '@/util/ast' import type { AstId } from '@/util/ast/abstract' import { findLastIndex, tryGetIndex } from '@/util/data/array' @@ -118,7 +122,7 @@ export class ArgumentPlaceholder extends Argument { /** TODO: Add docs */ override get hideByDefault(): boolean { - return this.argInfo.hasDefault && this.dynamicConfig?.display !== DisplayMode.Always + return !isRequiredArgument(this.argInfo) && this.dynamicConfig?.display !== DisplayMode.Always } } diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/DB_Table.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/DB_Table.enso index 4d41918bd8..25da867e82 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/DB_Table.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/DB_Table.enso @@ -9,6 +9,7 @@ import Standard.Base.Errors.Common.Floating_Point_Equality import Standard.Base.Errors.Common.Incomparable_Values import Standard.Base.Errors.Common.Index_Out_Of_Bounds import Standard.Base.Errors.Common.Type_Error +import Standard.Base.Errors.Common.Missing_Argument import Standard.Base.Errors.Deprecated.Deprecated import Standard.Base.Errors.File_Error.File_Error import Standard.Base.Errors.Illegal_Argument.Illegal_Argument @@ -1495,7 +1496,7 @@ type DB_Table @join_kind Widget_Helpers.make_join_kind_selector @on Widget_Helpers.make_join_condition_selector join : DB_Table -> Join_Kind -> Join_Condition | Text | Vector (Join_Condition | Text) -> Text -> Problem_Behavior -> DB_Table - join self right (join_kind : Join_Kind = ..Left_Outer) (on : Join_Condition | Text | Vector (Join_Condition | Text) = (default_join_condition self join_kind)) (right_prefix:Text="Right ") (on_problems:Problem_Behavior=..Report_Warning) = + join self right=(Missing_Argument.throw "right") (join_kind : Join_Kind = ..Left_Outer) (on : Join_Condition | Text | Vector (Join_Condition | Text) = (default_join_condition self join_kind)) (right_prefix:Text="Right ") (on_problems:Problem_Behavior=..Report_Warning) = Feature.Join.if_supported_else_throw self.connection.dialect "join" <| self.join_or_cross_join right join_kind on right_prefix on_problems diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso index 641da532d9..c7147eb87b 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso @@ -8,6 +8,7 @@ import Standard.Base.Errors.Common.Additional_Warnings import Standard.Base.Errors.Common.Floating_Point_Equality import Standard.Base.Errors.Common.Incomparable_Values import Standard.Base.Errors.Common.Index_Out_Of_Bounds +import Standard.Base.Errors.Common.Missing_Argument import Standard.Base.Errors.Common.No_Such_Method import Standard.Base.Errors.Common.Out_Of_Memory import Standard.Base.Errors.Common.Type_Error @@ -2665,7 +2666,7 @@ type Table @join_kind Widget_Helpers.make_join_kind_selector @on Widget_Helpers.make_join_condition_selector join : Table -> Join_Kind -> Vector (Join_Condition | Text) | Text -> Text -> Problem_Behavior -> Table - join self right:Table (join_kind : Join_Kind = ..Left_Outer) on=[Join_Condition.Equals self.column_names.first] right_prefix:Text="Right " on_problems:Problem_Behavior=..Report_Warning = Out_Of_Memory.handle_java_exception "join" <| + join self right:Table=(Missing_Argument.throw "right") (join_kind : Join_Kind = ..Left_Outer) on=[Join_Condition.Equals self.column_names.first] right_prefix:Text="Right " on_problems:Problem_Behavior=..Report_Warning = Out_Of_Memory.handle_java_exception "join" <| columns_to_keep = case join_kind of Join_Kind.Left_Exclusive -> [True, False] Join_Kind.Right_Exclusive -> [False, True]