Skip to content

Commit

Permalink
Making up-to-date with develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Apr 28, 2023
2 parents e1d1429 + c0679af commit 162048a
Show file tree
Hide file tree
Showing 235 changed files with 10,945 additions and 4,668 deletions.
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
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
12 changes: 12 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].

#### EnsoGL (rendering engine)

Expand Down Expand Up @@ -194,6 +198,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 @@ -389,6 +394,10 @@
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]
- [Implemented `create_database_table` allowing upload of in-memory
tables.][6429]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -590,6 +599,9 @@
[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
[6429]: https://github.com/enso-org/enso/pull/6429

#### Enso Compiler

Expand Down
37 changes: 20 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
52 changes: 52 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,58 @@ 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)]
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 Display for ExecutionEnvironment {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Design => write!(f, "design"),
Self::Live => write!(f, "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]
}
}

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
2 changes: 2 additions & 0 deletions app/gui/docs/product/shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ 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>k</kbd> | Switch the execution environment to Design. |
| <kbd>cmd</kbd>+<kbd>shift</kbd>+<kbd>l</kbd> | Switch the execution environment to Live. |

#### 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 162048a

Please sign in to comment.