Skip to content

Commit

Permalink
Merge branch 'develop' into wip/frizi/new-node-design
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Jul 25, 2023
2 parents 5b615e4 + 7211c83 commit 70f1d90
Show file tree
Hide file tree
Showing 63 changed files with 1,013 additions and 417 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
- [Help chat][7151]. The link to the Discord server is replaced with a chat
bridge to the Discord server. This is intended to have the chat visible at the
same time as the IDE, so that help can be much more interactive.
- [The libraries' authors may put entities to groups by adding GROUP tag in the
docstring]. It was requested as more convenient way than specifying full names
in package.yaml.
- [Graph editor node was redesigned][7311]. Nodes have a color and icon matching
the selected entry in the component browser. Clear separating lines between
method arguments were added. The node selection was made easier with
Expand All @@ -230,6 +233,7 @@
[7151]: https://github.com/enso-org/enso/pull/7151
[7164]: https://github.com/enso-org/enso/pull/7164
[7372]: https://github.com/enso-org/enso/pull/7372
[7337]: https://github.com/enso-org/enso/pull/7337
[7311]: https://github.com/enso-org/enso/pull/7311

#### EnsoGL (rendering engine)
Expand Down
18 changes: 16 additions & 2 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ debug-assertions = true
console-subscriber = "0.1.8"
nix = "0.26.1"
octocrab = { git = "https://github.com/enso-org/octocrab", default-features = false, features = [
"rustls"
"rustls",
] }
regex = { version = "1.6.0" }
serde_yaml = { version = "0.9.16" }
serde-wasm-bindgen = { version = "0.4.5" }
tokio = { version = "1.23.0", features = ["full", "tracing"] }
tokio-stream = { version = "0.1.12", features = ["fs"] }
tokio-util = { version = "0.7.4", features = ["full"] }
wasm-bindgen = { version = "0.2.84", features = ["serde-serialize"] }
wasm-bindgen = { version = "0.2.84", features = [] }
wasm-bindgen-test = { version = "0.3.34" }
anyhow = { version = "1.0.66" }
failure = { version = "0.1.8" }
Expand Down Expand Up @@ -135,7 +135,11 @@ syn = { version = "1.0", features = [
] }
quote = { version = "1.0.23" }
semver = { version = "1.0.0", features = ["serde"] }
strum = { version = "0.24.0", features = ["derive"] }
thiserror = "1.0.40"
bytemuck = { version = "1.13.1", features = ["derive"] }
bitflags = { version = "2.2.1" }
superslice = { version = "1.0.0" }
# We don't use serde-wasm-bindgen in some cases, because it cannot deal properly with flattened fields, see:
# https://github.com/cloudflare/serde-wasm-bindgen/issues/9
gloo-utils = { version = "0.1.7" }
10 changes: 4 additions & 6 deletions app/gui/controller/double-representation/src/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ pub mod project;
pub enum InvalidQualifiedName {
#[fail(display = "The qualified name is empty.")]
EmptyName,
#[fail(display = "No namespace in project qualified name.")]
NoNamespace,
#[fail(display = "Invalid namespace in project qualified name.")]
InvalidNamespace,
#[fail(display = "Too many segments in project qualified name.")]
#[fail(display = "Too few segments in qualified name.")]
TooFewSegments,
#[fail(display = "Too many segments in qualified name.")]
TooManySegments,
}

Expand Down Expand Up @@ -156,7 +154,7 @@ impl QualifiedName {
let mut iter = segments.into_iter().map(|name| name.into());
let project_name = match (iter.next(), iter.next()) {
(Some(ns), Some(name)) => project::QualifiedName::new(ns, name),
_ => return Err(InvalidQualifiedName::NoNamespace.into()),
_ => return Err(InvalidQualifiedName::TooFewSegments.into()),
};
let without_main = iter.skip_while(|s| *s == PROJECTS_MAIN_MODULE);
Ok(Self::new(project_name, without_main.collect()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl QualifiedName {
match all_segments.as_slice() {
[namespace, project] => Ok(Self::new(namespace, project)),
[] => Err(InvalidQualifiedName::EmptyName.into()),
[_] => Err(InvalidQualifiedName::NoNamespace.into()),
[_] => Err(InvalidQualifiedName::TooFewSegments.into()),
_ => Err(InvalidQualifiedName::TooManySegments.into()),
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/gui/controller/engine-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mockall = { version = "0.7.1", features = ["nightly"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { workspace = true }
sha3 = { version = "0.8.2" }
strum = "0.24.0"
strum = { workspace = true }
strum_macros = "0.24.0"
uuid = { version = "0.8", features = ["serde", "v4", "wasm-bindgen"] }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ pub struct LibraryComponentGroup {
pub color: Option<String>,
pub icon: Option<String>,
/// The list of components provided by this component group.
#[serde(default)]
pub exports: Vec<LibraryComponent>,
}

Expand Down
12 changes: 8 additions & 4 deletions app/gui/src/controller/searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::prelude::*;

use crate::controller::graph::ImportType;
use crate::controller::graph::RequiredImport;
use crate::model::execution_context::GroupQualifiedName;
use crate::model::module::NodeEditStatus;
use crate::model::suggestion_database;
use crate::presenter::searcher;
Expand Down Expand Up @@ -39,6 +40,8 @@ pub mod input;
/// needed. Currently enabled to trigger engine's caching of user-added nodes.
/// See: https://github.com/enso-org/ide/issues/1067
pub const ASSIGN_NAMES_FOR_NODES: bool = true;
/// A name of a component group containing entries representing literals.
pub const LITERALS_GROUP_NAME: &str = "Literals";


// ==============
Expand Down Expand Up @@ -717,9 +720,9 @@ impl Searcher {

fn add_virtual_entries_to_builder(builder: &mut component::Builder) {
let snippets = component::hardcoded::INPUT_SNIPPETS.with(|s| s.clone());
let group_name = component::hardcoded::INPUT_GROUP_NAME;
let project = project::QualifiedName::standard_base_library();
builder.add_virtual_entries_to_group(group_name, project, snippets);
// Unwrap is safe because conversion from INPUT_GROUP_NAME is tested.
let group_name = GroupQualifiedName::try_from(component::hardcoded::INPUT_GROUP_NAME).unwrap();
builder.add_virtual_entries_to_group(group_name, snippets);
}


Expand Down Expand Up @@ -865,8 +868,9 @@ fn component_list_for_literal(
) -> component::List {
let mut builder = component::builder::Builder::new_empty(db);
let project = project::QualifiedName::standard_base_library();
let group_name = GroupQualifiedName::new(project, LITERALS_GROUP_NAME);
let snippet = component::hardcoded::Snippet::from_literal(literal, db).into();
builder.add_virtual_entries_to_group("Literals", project, vec![snippet]);
builder.add_virtual_entries_to_group(group_name, vec![snippet]);
builder.build()
}

Expand Down
9 changes: 4 additions & 5 deletions app/gui/src/controller/searcher/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use crate::prelude::*;

use crate::controller::graph::RequiredImport;
use crate::controller::searcher::Filter;
use crate::model::execution_context::GroupQualifiedName;
use crate::model::suggestion_database;

use double_representation::name::project;
use enso_doc_parser::DocSection;
use enso_doc_parser::Tag;
use enso_suggestion_database::entry;
Expand Down Expand Up @@ -47,11 +48,9 @@ const ALIAS_MATCH_ATTENUATION_FACTOR: f32 = 0.75;
#[allow(missing_docs)]
#[derive(Clone, Debug, Default)]
pub struct Group {
/// The project where the group is defined.
pub project: project::QualifiedName,
pub name: ImString,
pub name: GroupQualifiedName,
/// Color as defined in project's `package.yaml` file.
pub color: Option<color::Rgb>,
pub color: Option<color::Rgb>,
}


Expand Down
Loading

0 comments on commit 70f1d90

Please sign in to comment.