Skip to content

Commit

Permalink
Merge branch 'develop' into wip/procrat/home-button-6399
Browse files Browse the repository at this point in the history
* develop: (30 commits)
  Widgets, Vector as Column, Viz Fixes and Rename Columns (#6768)
  Implement simple variants of `parse` for the Database backend (#6731)
  Enable `require-jsdoc` lint and add two lints related to React (#6403)
  Decimal/Integer .round and .int #6654 (#6743)
  Set suggestion reexports when serializing the library (#6778)
  Fix file uploading node expression. (#6689)
  Using WarningsLibrary to query for warnings (#6751)
  Implement `cast` for Table and Column (#6711)
  Display Initializing project... message when initializing project (#6661)
  Only send suggestions updates when type changes (#6755)
  sbt runEngineDistribution --debug to ease debuggging (#6745)
  Display "modified at" column on the cloud dashboard (#6687)
  Meta.meta Integer . methods (#6740)
  Show spinner while loading directory (#6714)
  Add cloud dashboard to changelog (#6688)
  Fix list editor panics during insertion (#6540)
  Update bug-report.yml
  Remove project create form (#6710)
  Change full-screen visualisation shortcut to shift-space (#6663)
  Revert "Show spinner when opening/creating a project (#6321)" (#6712)
  ...
  • Loading branch information
Procrat committed May 22, 2023
2 parents 9d0c29a + 62fecfa commit 46418f1
Show file tree
Hide file tree
Showing 238 changed files with 6,028 additions and 2,976 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ body:
description: "On which browser do you experience this issue?"
multiple: true
options:
- "Standalone distribution"
- "Standalone distribution (local project)"
- "Standalone distribution (cloud project)"
- "Chrome"
- "Chromium"
- "Safari (not supported officialy, but should work)"
Expand Down
25 changes: 20 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,23 @@
<kbd>cmd</kbd>+<kbd>alt</kbd>+<kbd>t</kbd>/<kbd>r</kbd>.
- [Fixed a bug where selecting a nested breadcrumb would cause the order of
breadcrumbs to change incorrectly.][6617]
- [Changed the shortcut to show the full-screen visualization for a node from
<kbd>space</kbd> <kbd>space</kbd> to <kbd>shift</kbd>+<kbd>space</kbd>.][6663]
so that it doesn't interfere with the shortcut for toggling the small
visualization.
- [Cloud dashboard, which supersedes the startup screen][6279]. Features also
added in various other PRs. The new dashboard includes tables for projects,
folders, files and secrets, a list of templates from which new projects can be
created, a user menu, and a search bar.
- [Added a button to return from an opened project back to the project
dashboard.][6474]

[6279]: https://github.com/enso-org/enso/pull/6279
[6421]: https://github.com/enso-org/enso/pull/6421
[6530]: https://github.com/enso-org/enso/pull/6530
[6620]: https://github.com/enso-org/enso/pull/6620
[6617]: https://github.com/enso-org/enso/pull/6617
[6620]: https://github.com/enso-org/enso/pull/6620
[6663]: https://github.com/enso-org/enso/pull/6663
[6474]: https://github.com/enso-org/enso/pull/6474

#### EnsoGL (rendering engine)
Expand Down Expand Up @@ -220,17 +230,16 @@

[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
[4047]: https://github.com/enso-org/enso/pull/4047
[5895]: https://github.com/enso-org/enso/pull/5895
[5895]: https://github.com/enso-org/enso/pull/6130
[6035]: https://github.com/enso-org/enso/pull/6035
[6097]: https://github.com/enso-org/enso/pull/6097
[6097]: https://github.com/enso-org/enso/pull/6341
[6130]: https://github.com/enso-org/enso/pull/6130
[6366]: https://github.com/enso-org/enso/pull/6366
[6487]: https://github.com/enso-org/enso/pull/6487
[6341]: https://github.com/enso-org/enso/pull/6341
[6470]: https://github.com/enso-org/enso/pull/6470
[6487]: https://github.com/enso-org/enso/pull/6487
[6512]: https://github.com/enso-org/enso/pull/6512

#### Enso Standard Library
Expand Down Expand Up @@ -439,6 +448,8 @@
- [Added `at_least_one` flag to `Table.tokenize_to_rows`.][6539]
- [Moved `Redshift` connector into a separate `AWS` library.][6550]
- [Added `Date_Range`.][6621]
- [Implemented the `cast` operation for `Table` and `Column`.][6711]
- [Added `.round` and `.int` to `Integer` and `Decimal`.][6743]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -649,6 +660,8 @@
[6539]: https://github.com/enso-org/enso/pull/6539
[6550]: https://github.com/enso-org/enso/pull/6550
[6621]: https://github.com/enso-org/enso/pull/6621
[6711]: https://github.com/enso-org/enso/pull/6711
[6743]: https://github.com/enso-org/enso/pull/6743

#### Enso Compiler

Expand Down Expand Up @@ -759,6 +772,7 @@
- [Warning.get_all returns only unique warnings][6372]
- [Reimplement `enso_project` as a proper builtin][6352]
- [Limit number of reported warnings per value][6577]
- [Suggestions are updated only when the type of the expression changes][6755]

[3227]: https://github.com/enso-org/enso/pull/3227
[3248]: https://github.com/enso-org/enso/pull/3248
Expand Down Expand Up @@ -869,6 +883,7 @@
[6372]: https://github.com/enso-org/enso/pull/6372
[6352]: https://github.com/enso-org/enso/pull/6352
[6577]: https://github.com/enso-org/enso/pull/6577
[6755]: https://github.com/enso-org/enso/pull/6755

# Enso 2.0.0-alpha.18 (2021-10-12)

Expand Down
37 changes: 22 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,4 @@ syn = { version = "1.0", features = [
quote = { version = "1.0.23" }
semver = { version = "1.0.0", features = ["serde"] }
thiserror = "1.0.40"
bitflags = { version = "2.2.1" }
20 changes: 10 additions & 10 deletions app/gui/language/span-tree/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<T: Payload> ChildGenerator<T> {
let kind = kind.into();
let size = self.current_offset;
let children = self.children;
Node { kind, size, children, ast_id, parenthesized: false, payload: default() }
Node { kind, size, children, ast_id, ..default() }
}
}

Expand Down Expand Up @@ -498,12 +498,11 @@ fn generate_node_for_opr_chain<T: Payload>(

Ok((
Node {
kind: if is_last { kind.clone() } else { node::Kind::chained().into() },
parenthesized: false,
size: gen.current_offset,
children: gen.children,
ast_id: elem.infix_id,
payload: default(),
kind: if is_last { kind.clone() } else { node::Kind::chained().into() },
size: gen.current_offset,
children: gen.children,
ast_id: elem.infix_id,
..default()
},
elem.offset,
))
Expand Down Expand Up @@ -778,11 +777,12 @@ fn generate_expected_argument<T: Payload>(
argument_info: ArgumentInfo,
) -> Node<T> {
let mut gen = ChildGenerator::default();
let extended_ast_id = node.ast_id.or(node.extended_ast_id);
gen.add_node(ast::Crumbs::new(), node);
let arg_node = gen.generate_empty_node(InsertionPointType::ExpectedArgument { index, named });
arg_node.node.set_argument_info(argument_info);
let kind = node::Kind::chained().into();
Node { kind, size: gen.current_offset, children: gen.children, ..default() }
Node { kind, size: gen.current_offset, children: gen.children, extended_ast_id, ..default() }
}

/// Build a prefix application-like span tree structure where no prefix argument has been provided
Expand Down Expand Up @@ -873,8 +873,7 @@ fn tree_generate_node<T: Payload>(
}
size = parent_offset;
}
let payload = default();
Ok(Node { kind, parenthesized, size, children, ast_id, payload })
Ok(Node { kind, parenthesized, size, children, ast_id, ..default() })
}


Expand Down Expand Up @@ -940,6 +939,7 @@ mod test {
/// cleaner the expression IDs are removed before comparing trees.
fn clear_expression_ids<T>(node: &mut Node<T>) {
node.ast_id = None;
node.extended_ast_id = None;
for child in &mut node.children {
clear_expression_ids(&mut child.node);
}
Expand Down
26 changes: 26 additions & 0 deletions app/gui/language/span-tree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,29 @@ impl<T> SpanTree<T> {
let root = self.root.map(f);
SpanTree { root }
}

/// Map over the nodes in given crumbs chain, from the root to the node identified by the
/// crumbs. Terminates on the first `Some(R)` result and returns it.
pub fn find_map_in_chain<'a, R, F>(
&self,
crumbs: impl IntoIterator<Item = &'a Crumb>,
mut f: F,
) -> Option<R>
where
F: FnMut(usize, &Node<T>) -> Option<R>,
{
let mut crumbs = crumbs.into_iter();
let mut current_node = &self.root;
let mut idx = 0;
loop {
let result = f(idx, current_node);
if result.is_some() {
return result;
}
idx += 1;
current_node = current_node.children.get(*crumbs.next()?)?;
}
}
}


Expand Down Expand Up @@ -305,7 +328,10 @@ impl<T> SpanTree<T> {

if let Some(ast_id) = node.ast_id {
write!(buffer, " ast_id={ast_id:?}").unwrap();
} else if let Some(ext_id) = node.extended_ast_id {
write!(buffer, " ext_id={ext_id:?}").unwrap();
}

buffer.push('\n');

let num_children = node.children.len();
Expand Down
19 changes: 12 additions & 7 deletions app/gui/language/span-tree/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ pub trait Payload = Default + Clone;
#[derive(Clone, Debug, Default, Eq, PartialEq)]
#[allow(missing_docs)]
pub struct Node<T> {
pub kind: Kind,
pub size: ByteDiff,
pub children: Vec<Child<T>>,
pub ast_id: Option<ast::Id>,
pub parenthesized: bool,
pub payload: T,
pub kind: Kind,
pub size: ByteDiff,
pub children: Vec<Child<T>>,
pub ast_id: Option<ast::Id>,
/// When this `Node` is a part of an AST extension (a virtual span that only exists in
/// span-tree, but not in AST), this field will contain the AST ID of the expression it extends
/// (e.g. the AST of a function call with missing arguments, extended with expected arguments).
pub extended_ast_id: Option<ast::Id>,
pub parenthesized: bool,
pub payload: T,
}

impl<T> Deref for Node<T> {
Expand Down Expand Up @@ -74,8 +78,9 @@ impl<T> Node<T> {
let size = self.size;
let children = self.children.into_iter().map(|t| t.map(f)).collect_vec();
let ast_id = self.ast_id;
let extended_ast_id = self.extended_ast_id;
let payload = f(self.payload);
Node { kind, parenthesized, size, children, ast_id, payload }
Node { kind, parenthesized, size, children, ast_id, extended_ast_id, payload }
}
}

Expand Down
Loading

0 comments on commit 46418f1

Please sign in to comment.