Skip to content

Commit

Permalink
Merge branch 'develop' into wip/akirathan/sort-incomparable-5742
Browse files Browse the repository at this point in the history
  • Loading branch information
Akirathan committed Apr 3, 2023
2 parents 38057d7 + 0d7682b commit 8bd3e00
Show file tree
Hide file tree
Showing 328 changed files with 22,617 additions and 43,676 deletions.
5 changes: 3 additions & 2 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
overrides:
- files:
- "*.[j|t]s"
- "*.mjs"
- "*.cjs"
- "*.[j|t]sx"
- "*.m[j|t]s"
- "*.c[j|t]s"
options:
printWidth: 100
tabWidth: 4
Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,16 @@
all symbols rendered in a given frame. You can also pause the performance
monitor and inspect results recorded in the past.
- [ToggleButtons can now have tooltips][6035].
- [Rendering of tooltips was improved.][6097] Their text is now more vertically
centered and the delay before showing them was extended.

[3857]: https://github.com/enso-org/enso/pull/3857
[3985]: https://github.com/enso-org/enso/pull/3985
[4047]: https://github.com/enso-org/enso/pull/4047
[4003]: https://github.com/enso-org/enso/pull/4003
[5895]: https://github.com/enso-org/enso/pull/5895
[6035]: https://github.com/enso-org/enso/pull/6035
[6097]: https://github.com/enso-org/enso/pull/6097

#### Enso Standard Library

Expand Down Expand Up @@ -363,8 +366,13 @@
- [Aligned names of columns created by column operations.][5850]
- [Improved `cross_tab`. Renamed `fill_missing` and `is_missing` to
`fill_nothing` and `is_nothing`. Added `fill_empty`.][5863]
- [Removed many regex compile flags from `replace`; added `only_first`
flag.][5959]
- [Removed many regex compile flags from `replace`; added `only_first` and
`use_regex` flag.][5959]
- [Removed many regex compile flags from `split`; added `only_first` and
`use_regex` flag.][6116]
- [Implemented proper support for Value Types in the Table library.][6073]
- [Added support for Date/Time columns in the Postgres backend and added
`year`/`month`/`day` operations to Table columns.][6153]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -553,6 +561,9 @@
[5917]: https://github.com/enso-org/enso/pull/5917
[5705]: https://github.com/enso-org/enso/pull/5705
[5959]: https://github.com/enso-org/enso/pull/5959
[6116]: https://github.com/enso-org/enso/pull/6116
[6073]: https://github.com/enso-org/enso/pull/6073
[6153]: https://github.com/enso-org/enso/pull/6153

#### Enso Compiler

Expand Down
3 changes: 3 additions & 0 deletions app/gui/language/span-tree/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ fn generate_node_for_prefix_chain<T: Payload>(
context: &impl Context,
) -> FallibleResult<Node<T>> {
let app_base = ApplicationBase::from_prefix_chain(this);
let fallback_call_id = app_base.call_id;
let mut application = app_base.resolve(context);

// When using method notation, expand the infix access chain manually to maintain correct method
Expand Down Expand Up @@ -585,6 +586,8 @@ fn generate_node_for_prefix_chain<T: Payload>(
if let Some((index, info)) = info {
arg_kind.set_argument_info(info);
arg_kind.set_definition_index(index);
} else {
arg_kind.set_call_id(fallback_call_id);
}

if !resolved {
Expand Down
19 changes: 19 additions & 0 deletions app/gui/language/span-tree/src/node/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,25 @@ impl Kind {
}
}

/// Call ID setter. Returns bool indicating whether the operation was possible.
pub fn set_call_id(&mut self, call_id: Option<ast::Id>) -> bool {
match self {
Self::Chained(t) => {
t.call_id = call_id;
true
}
Self::Argument(t) => {
t.call_id = call_id;
true
}
Self::InsertionPoint(t) => {
t.call_id = call_id;
true
}
_ => false,
}
}

/// Short string representation. Skips the inner fields and returns only the variant name.
pub fn variant_name(&self) -> &str {
match self {
Expand Down
5 changes: 3 additions & 2 deletions app/gui/src/controller/searcher/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,14 @@ impl InsertContext<'_> {
/// infix chain of `ACCESS` operators with identifiers.
fn has_qualified_name(&self) -> bool {
if let Some(ref context) = self.context {
let there_are_operands = context.enumerate_operands().flatten().count() > 0;
let every_operand_is_name = context.enumerate_operands().flatten().all(|opr| {
matches!(opr.item.arg.shape(), ast::Shape::Cons(_) | ast::Shape::Var(_))
});
let every_operator_is_access = context
.enumerate_operators()
.all(|opr| opr.item.ast().repr() == ast::opr::predefined::ACCESS);
every_operand_is_name && every_operator_is_access
there_are_operands && every_operand_is_name && every_operator_is_access
} else {
false
}
Expand All @@ -425,7 +426,7 @@ impl InsertContext<'_> {
.flatten()
.filter_map(|opr| ast::identifier::name(&opr.item.arg).map(ImString::new))
.collect_vec();
Some(name_segments)
(!name_segments.is_empty()).as_some(name_segments)
} else {
None
}
Expand Down
7 changes: 0 additions & 7 deletions app/gui/src/presenter/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ impl Model {
);
}

/// Node expression was edited in the view. Should be called whenever the user changes the
/// contents of a node during editing.
fn node_expression_set(&self, id: ViewNodeId, expression: ImString) {
self.state.update_from_view().set_node_expression(id, expression);
}

/// Update a part of node expression under specific span tree crumbs. Preserves identity of
/// unaffected parts of the expression.
fn node_expression_span_set(
Expand Down Expand Up @@ -709,7 +703,6 @@ impl Graph {
eval view.on_edge_endpoint_unset(((edge_id,_)) model.connection_removed(*edge_id));
eval view.nodes_collapsed(((nodes, _)) model.nodes_collapsed(nodes));
eval view.enabled_visualization_path(((node_id, path)) model.node_visualization_changed(*node_id, path.clone()));
eval view.node_expression_set(((node_id, expression)) model.node_expression_set(*node_id, expression.clone_ref()));
eval view.node_expression_span_set(((node_id, crumbs, expression)) model.node_expression_span_set(*node_id, crumbs, expression.clone_ref()));
eval view.node_action_skip(((node_id, enabled)) model.node_action_skip(*node_id, *enabled));
eval view.node_action_freeze(((node_id, enabled)) model.node_action_freeze(*node_id, *enabled));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub mod separator {
ensogl_core::shape! {
above = [ensogl_grid_view::entry::shape];
pointer_events = false;
alignment = center;
(style: Style) {
let color = style.get_color(theme::separator::color);
let width = style.get_number(theme::separator::width);
Expand All @@ -58,6 +59,7 @@ pub mod ellipsis {
ensogl_core::shape! {
above = [ensogl_grid_view::entry::shape];
pointer_events = false;
alignment = center;
(style: Style) {
let radius = style.get_number(theme::ellipsis::circles_radius).px();
let gap = style.get_number(theme::ellipsis::circles_gap).px();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ mod mask {
use ensogl_core::display::shape::*;
ensogl_core::shape! {
pointer_events = false;
alignment = center;
(style: Style, corners_radius: f32) {
let width = Var::<Pixels>::from("input_size.x");
let height = Var::<Pixels>::from("input_size.y");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub mod background {
ensogl_core::shape! {
below = [grid_view::entry::overlay, grid_view::selectable::highlight::shape, icon::any];
pointer_events = false;
alignment = center;
(style:Style, color:Vector4, height: f32, shadow_height_multiplier: f32) {
let color = Var::<color::Rgba>::from(color);
let width: Var<Pixels> = "input_size.x".into();
Expand Down Expand Up @@ -231,6 +232,7 @@ impl Data {
display_object.add_child(&background);
display_object.add_child(&icon);
display_object.add_child(&label);
background.set_size((0.0, 0.0));
icon.set_size((icon::SIZE, icon::SIZE));
label.set_long_text_truncation_mode(true);
if let Some(layer) = text_layer {
Expand Down Expand Up @@ -265,8 +267,9 @@ impl Data {
_ => grid_style.column_width(),
};
let bg_height = entry_size.y + overlap;
// See comment in [`Self::update_shadow`] method.
let shadow_addition = self.background.computed_size().y - self.background.height.get();
// See comment in [`Self::update_shadow`] method
let background_y = self.background.size().y().as_pixels().expect("size set in pixels");
let shadow_addition = background_y - self.background.height.get();
let bg_sprite_height = bg_height + shadow_addition;
let bg_y = -gap_over_header + overlap / 2.0 + local_scope_offset;
self.background.set_y(bg_y);
Expand Down Expand Up @@ -327,7 +330,7 @@ impl Data {
entry_size: Vector2,
) {
if header_position.position != Vector2::default() {
let bg_width = self.background.computed_size().x;
let bg_width = self.background.size().x().as_pixels().expect("size set in pixels");
let bg_height = self.background.height.get();
let distance_to_section_top =
header_position.y_range.end() - header_position.position.y;
Expand Down
Loading

0 comments on commit 8bd3e00

Please sign in to comment.