Skip to content

Commit

Permalink
Merge branch 'develop' into wip/procrat/json-viz-last-row-6196
Browse files Browse the repository at this point in the history
* develop:
  Passing events to sub-widgets in List Editor and refactoring of the slider component. (#6433)
  Revert "Cloud/desktop mode switcher (#6308)" (#6444)
  Widgets integrated with graph nodes (#6347)
  Table Visualization and display text changes. (#6382)
  Skip redundant compilations (#6436)
  Add parse extensions to Text type. #6330 (#6404)
  Cloud/desktop mode switcher (#6308)
  Replace Table should_equal with should_equal_verbose (#6405)
  Rollback event handling changes for the mouse (#6396)
  Dashboard directory interactivity (#6279)
  Ability to change the execution environment between design and live. (#6341)
  Implementation of elements adding to List Editor and a lot of internal API (#6390)
  Drop method exported from WASM + removing leaks. (#6365)
  Turn null into UnexpectedExpression when Union type is incomplete (#6415)
  • Loading branch information
Procrat committed Apr 27, 2023
2 parents 0b6fd09 + ae94a9f commit 9452501
Show file tree
Hide file tree
Showing 183 changed files with 9,998 additions and 4,306 deletions.
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Cargo.toml
# Engine (old)
# This section should be removed once the engine moves to /app/engine
/build.sbt @4e6 @jaroslavtulach @hubertp
/distribution/ @4e6 @jdunkerley @radeusgd
/distribution/ @4e6 @jdunkerley @radeusgd @GregoryTravis
/engine/ @4e6 @jaroslavtulach @hubertp
/project/ @4e6 @jaroslavtulach @hubertp
/test/ @jdunkerley @radeusgd
/test/ @jdunkerley @radeusgd @GregoryTravis
/tools/ @4e6 @jaroslavtulach @radeusgd

# Enso Libraries
# This section should be amended once the engine moves to /app/engine
/distribution/lib/ @jdunkerley @radeusgd
/std-bits/ @jdunkerley @radeusgd
/distribution/lib/ @jdunkerley @radeusgd @GregoryTravis
/std-bits/ @jdunkerley @radeusgd @GregoryTravis

# Cloud Dashboard & Authentication
/app/ide-desktop/lib/dashboard @PabloBuchu @indiv0 @somebody1234
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
quickly understand each button's function.
- [File associations are created on Windows and macOS][6077]. This allows
opening Enso files by double-clicking them in the file explorer.
- [Added capability to create node widgets with complex UI][6347]. Node widgets
such as dropdown can now be placed in the node and affect the code text flow.
- [The IDE UI element for selecting the execution mode of the project is now
sending messages to the backend.][6341].
- [Fixed text visualisations which were being cut off at the last line.][6421]

[6421]: https://github.com/enso-org/enso/pull/6421
Expand Down Expand Up @@ -197,6 +201,7 @@
[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

#### Enso Standard Library

Expand Down Expand Up @@ -392,6 +397,8 @@
for thousands and decimal point automatic detection.][6253]
- [Implemented `Table.parse_text_to_table`.][6294]
- [Added `Table.parse_to_columns`.][6383]
- [Added parsing methods for `Integer`, `Decimal`, `Json`, `Date`, `Date_Time`,
`Time_Of_Day`, `Time_Zone`, and `URI` to `Text`.][6404]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -593,6 +600,8 @@
[6253]: https://github.com/enso-org/enso/pull/6253
[6294]: https://github.com/enso-org/enso/pull/6294
[6383]: https://github.com/enso-org/enso/pull/6383
[6404]: https://github.com/enso-org/enso/pull/6404
[6347]: https://github.com/enso-org/enso/pull/6347

#### Enso Compiler

Expand Down
36 changes: 19 additions & 17 deletions Cargo.lock

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

7 changes: 6 additions & 1 deletion app/gui/controller/engine-protocol/src/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ trait API {

/// Restart the program execution.
#[MethodInput=RecomputeInput, rpc_name="executionContext/recompute"]
fn recompute(&self, context_id: ContextId, invalidated_expressions: InvalidatedExpressions) -> ();
fn recompute(&self, context_id: ContextId, invalidated_expressions: InvalidatedExpressions, mode: Option<ExecutionEnvironment>) -> ();

/// Obtain the full suggestions database.
#[MethodInput=GetSuggestionsDatabaseInput, rpc_name="search/getSuggestionsDatabase"]
Expand Down Expand Up @@ -205,6 +205,11 @@ trait API {
/// VCS snapshot if no `commit_id` is provided.
#[MethodInput=VcsRestoreInput, rpc_name="vcs/restore"]
fn restore_vcs(&self, root: Path, commit_id: Option<String>) -> response::RestoreVcs;

/// Set the execution environment of the context for future evaluations.
#[MethodInput=SetModeInput, rpc_name="executionContext/setExecutionEnvironment"]
fn set_execution_environment(&self, context_id: ContextId, execution_environment: ExecutionEnvironment) -> ();

}}


Expand Down
66 changes: 66 additions & 0 deletions app/gui/controller/engine-protocol/src/language_server/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,72 @@ pub struct LibraryComponentGroup {
}



// =============================
// === Execution Environment ===
// =============================

/// The execution environment which controls the global execution of functions with side effects.
///
/// For more information, see
/// https://github.com/enso-org/design/blob/main/epics/basic-libraries/write-action-control/design.md.
#[derive(Hash, Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Display)]
pub enum ExecutionEnvironment {
/// Allows editing the graph, but the `Output` context is disabled, so it prevents accidental
/// changes.
Design,
/// Unrestricted, live editing of data.
Live,
}

impl Default for ExecutionEnvironment {
fn default() -> Self {
ExecutionEnvironment::Design
}
}

impl ExecutionEnvironment {
/// List all available execution environments.
pub fn list_all() -> Vec<Self> {
vec![ExecutionEnvironment::Design, ExecutionEnvironment::Live]
}

/// List all available execution environments as ImStrings. Useful for UI.
pub fn list_all_as_imstrings() -> Vec<ImString> {
Self::list_all().iter().map(|env| (*env).into()).collect()
}
}

impl From<ExecutionEnvironment> for ImString {
fn from(env: ExecutionEnvironment) -> Self {
ImString::new(env.to_string())
}
}

impl TryFrom<&str> for ExecutionEnvironment {
type Error = ();

fn try_from(value: &str) -> core::result::Result<Self, Self::Error> {
match value.to_lowercase().as_str() {
"design" => Ok(ExecutionEnvironment::Design),
"live" => Ok(ExecutionEnvironment::Live),
_ => Err(()),
}
}
}

impl ExecutionEnvironment {
/// Returns whether the output context is enabled for this execution environment.
pub fn output_context_enabled(&self) -> bool {
match self {
Self::Design => false,
Self::Live => true,
}
}
}



// ======================
// === Test Utilities ===
// ======================
Expand Down
1 change: 1 addition & 0 deletions app/gui/docs/product/shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ broken and require further investigation.
| <kbd>escape</kbd> | Cancel current action. For example, drop currently dragged connection. |
| <kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>t</kbd> | Terminate the program execution |
| <kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>r</kbd> | Re-execute the program |
| <kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>e</kbd> | Toggle the execution environment between Live and Design. |

#### Navigation

Expand Down
12 changes: 6 additions & 6 deletions app/gui/language/span-tree/src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use ast::Ast;



/// ==============
/// === Errors ===
/// ==============
// ==============
// === Errors ===
// ==============

/// Error returned when tried to perform an action which is not available for specific SpanTree
/// node.
Expand All @@ -35,9 +35,9 @@ pub struct AstSpanTreeMismatch;



/// =====================
/// === Actions Trait ===
/// =====================
// =====================
// === Actions Trait ===
// =====================

/// Action enum used mainly for error messages.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
Expand Down
30 changes: 16 additions & 14 deletions app/gui/language/span-tree/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,23 @@ pub trait Builder<T: Payload>: Sized {
/// Add new AST-type child to node. Returns the child's builder which may be used to further
/// extend this branch of the tree.
fn add_child(
self,
offset: usize,
mut self,
parent_offset: usize,
len: usize,
kind: impl Into<node::Kind>,
crumbs: impl IntoCrumbs,
) -> ChildBuilder<Self, T> {
let kind = kind.into();
let node = Node::<T>::new().with_kind(kind).with_size(len.into());
let child = node::Child { node, offset: offset.into(), ast_crumbs: crumbs.into_crumbs() };
let prev_child = self.node_being_built().children.last();
let prev_child_end = prev_child.map_or(0, |c| (c.parent_offset + c.node.size).as_usize());
let sibling_offset = parent_offset.saturating_sub(prev_child_end);
let child = node::Child {
node,
parent_offset: parent_offset.into(),
sibling_offset: sibling_offset.into(),
ast_crumbs: crumbs.into_crumbs(),
};
ChildBuilder { built: child, parent: self }
}

Expand All @@ -46,14 +54,8 @@ pub trait Builder<T: Payload>: Sized {
}

/// Add an Empty-type child to node.
fn add_empty_child(mut self, offset: usize, kind: impl Into<node::Kind>) -> Self {
let child = node::Child {
node: Node::<T>::new().with_kind(kind),
offset: offset.into(),
ast_crumbs: vec![],
};
self.node_being_built().children.push(child);
self
fn add_empty_child(self, offset: usize, kind: impl Into<node::Kind>) -> Self {
self.add_leaf(offset, 0, kind, ast::crumbs![])
}

/// Set expression id for this node.
Expand All @@ -65,9 +67,9 @@ pub trait Builder<T: Payload>: Sized {



/// ================
/// === Builders ===
/// ================
// ================
// === Builders ===
// ================

// === SpanTree Builder ===

Expand Down
Loading

0 comments on commit 9452501

Please sign in to comment.