Skip to content

Commit

Permalink
Filter out Unresolved_Symbol when coloring ports (enso-org/ide#1408)
Browse files Browse the repository at this point in the history
Original commit: enso-org/ide@e74b8c3
  • Loading branch information
farmaazon authored Mar 30, 2021
1 parent 86d9e6b commit 1d7384f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ide/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ users about errors and where they originate.
- Cursors in text editors behave correctly now (they are not affected by scene
pan and zoom). This was possible because of the new multi-camera management
system implemented in EnsoGL.
- [Fixed method names highlighted in pink.][1408] There was a bug introduced
after one of the latest Engine updates, that sent `Unresolved_symbol` types,
which made all methods pink. This is fixed now.

#### EnsoGL (rendering engine)

Expand Down Expand Up @@ -263,6 +266,7 @@ you can find their release notes
[podcast-future-of-enso]:
https://www.youtube.com/watch?v=rF8DuJPOfTs&t=1863s&ab_channel=Enso
[1312]: https://github.com/enso-org/ide/pull/1312
[1408]: https://github.com/enso-org/ide/pull/1408

<br/>

Expand Down
12 changes: 10 additions & 2 deletions ide/src/rust/ide/view/graph-editor/src/component/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const ERROR_VISUALIZATION_SIZE : (f32,f32) = visualization::container::DEF

const VISUALIZATION_OFFSET_Y : f32 = -120.0;

/// A type of unresolved methods. We filter them out, because we don't want to treat them as types
/// for ports and edges coloring (due to bad UX otherwise).
const UNRESOLVED_SYMBOL_TYPE : &str = "Builtins.Main.Unresolved_Symbol";



// =============
Expand Down Expand Up @@ -573,8 +577,12 @@ impl Node {

// === Expression ===

eval frp.set_expression_usage_type (((a,b)) model.set_expression_usage_type(a,b));
eval frp.set_expression ((a) model.set_expression(a));
let unresolved_symbol_type = Some(Type(ImString::new(UNRESOLVED_SYMBOL_TYPE)));
filtered_usage_type <- frp.set_expression_usage_type.filter(
move |(_,tp)| *tp != unresolved_symbol_type
);
eval filtered_usage_type (((a,b)) model.set_expression_usage_type(a,b));
eval frp.set_expression ((a) model.set_expression(a));
out.source.expression <+ model.input.frp.expression;
model.input.set_connected <+ frp.set_input_connected;
model.output.set_expression_visibility <+ frp.set_output_expression_visibility;
Expand Down
2 changes: 1 addition & 1 deletion ide/src/rust/ide/view/graph-editor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ impl Display for EdgeId {
/// Typename information that may be associated with the given Port.
///
/// `None` means that type for the port is unknown.
#[derive(Clone,Debug,Default,Hash)]
#[derive(Clone,Debug,Default,Eq,Hash,PartialEq)]
pub struct Type(pub ImString);

impl Deref for Type {
Expand Down

0 comments on commit 1d7384f

Please sign in to comment.