Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
Engine 0.2.15 (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmaazon committed Jul 21, 2021
1 parent 8b971cd commit 3031f4a
Show file tree
Hide file tree
Showing 37 changed files with 591 additions and 296 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Next Release

#### Enso Compiler

- [Updated Enso engine to version 0.2.15][1710]. If you're interested in the
enhancements and fixes made to the Enso compiler, you can find out more
details in
[the engine release notes](https://github.com/enso-org/enso/blob/main/RELEASES.md).

[1710]: https://github.com/enso-org/ide/pull/1710

# Enso 2.0.0-alpha.9 (2021-07-16)

<br/>![New Features](/docs/assets/tags/new_features.svg)
Expand Down
4 changes: 2 additions & 2 deletions src/js/lib/client/tasks/signArchives.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const resRoot = path.join(contentRoot, 'Resources')

// TODO: Refactor this once we have a better wau to get the used engine version.
// See the tracking issue for more information https://github.com/enso-org/ide/issues/1359
const ENGINE = '0.2.12'
const ENGINE = '0.2.15'
const ID = '"Developer ID Application: New Byte Order Sp. z o. o. (NM77WTZJFQ)"'
// Placeholder name for temporary archives.
const tmpArchive = 'temporary_archive.zip'
Expand Down Expand Up @@ -110,7 +110,7 @@ function signArchive(archivePath, archiveName, binPaths) {
const toSign = [
{
jarDir:
`enso/dist/${ENGINE}/std-lib/Standard/polyglot/java`,
`enso/dist/${ENGINE}/lib/Standard/Database/0.1.0/polyglot/java`,
jarName: 'sqlite-jdbc-3.34.0.jar',
jarContent: [
'org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib',
Expand Down
2 changes: 1 addition & 1 deletion src/js/lib/project-manager/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function get_project_manager_url(): Promise<string> {
// This constant MUST be synchronized with `ENGINE` constant in src/js/lib/client/tasks/signArchives.js.
// Also it is usually a good idea to synchronize it with `ENGINE_VERSION_FOR_NEW_PROJECTS` in
// src/rust/ide/src/controller/project.rs. See also https://github.com/enso-org/ide/issues/1359
const version = '0.2.12'
const version = '0.2.15'
let base_url: string = 'https://github.com/enso-org/'
base_url += 'enso/releases/download/'
base_url += `enso-${version}/enso-project-manager-${version}`
Expand Down
1 change: 1 addition & 0 deletions src/rust/ide/lib/args/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ensogl::read_args! {
project_manager : String,
language_server_rpc : String,
language_server_data : String,
namespace : String,
platform : web::platform::Platform,
frame : bool,
theme : String,
Expand Down
10 changes: 2 additions & 8 deletions src/rust/ide/lib/enso-protocol/src/language_server/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::prelude::*;
use crate::language_server::API;
use crate::language_server::MockClient;
use crate::language_server::types::ContentRoot;
use crate::language_server::types::ContentRootType;

use uuid::Uuid;
use utils::fail::FallibleResult;
Expand Down Expand Up @@ -59,8 +58,7 @@ impl Connection {
}

fn extract_project_root(content_roots:&mut Vec<ContentRoot>) -> FallibleResult<ContentRoot> {
use ContentRootType::*;
let opt_index = content_roots.iter().position(|cr| cr.content_root_type == Project);
let opt_index = content_roots.iter().position(|cr| matches!(cr, ContentRoot::Project {..}));
let index = opt_index.ok_or(MissingContentRoots)?;
Ok(content_roots.drain(index..=index).next().unwrap())
}
Expand All @@ -70,11 +68,7 @@ impl Connection {
Connection {
client : Box::new(client),
client_id : default(),
project_root : ContentRoot {
id : default(),
content_root_type : ContentRootType::Project,
name : "Project".to_owned()
},
project_root : ContentRoot::Project {id:default()},
content_roots : default(),
}
}
Expand Down
7 changes: 1 addition & 6 deletions src/rust/ide/lib/enso-protocol/src/language_server/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,7 @@ fn test_file_requests() {
#[test]
fn test_protocol_connection() {
let init_protocol_connection_response = response::InitProtocolConnection {
content_roots: vec![ContentRoot {
id : default(),
content_root_type : ContentRootType::Project,
name : "Project".to_owned()
}]
content_roots: vec![ContentRoot::Project {id:default()}]
};
test_request(
|client| client.init_protocol_connection(&uuid::Uuid::default()),
Expand All @@ -277,7 +273,6 @@ fn test_protocol_connection() {
"contentRoots" : [{
"id" : "00000000-0000-0000-0000-000000000000",
"type" : "Project",
"name" : "Project",
}]
}),
init_protocol_connection_response
Expand Down
68 changes: 46 additions & 22 deletions src/rust/ide/lib/enso-protocol/src/language_server/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,32 +390,56 @@ impl FileSystemObject {
// === Content Roots ===
// =====================

/// The type of the annotated content root.
#[derive(Clone,Copy,Debug,Deserialize,Eq,Hash,PartialEq,Serialize)]
pub enum ContentRootType {
/// The project home.
Project,
/// System root `/` on unix systems, or drive root on Windows. In Windows’ case, there may be
/// multiple [`Root`] entries corresponding to the various drives.
Root,
/// The user’s home directory.
Home,
/// An Enso library location.
Library,
/// A content root that has been added by the IDE (unused for now).
Custom
}

/// A content root represents a location on a real file-system that has been virtualized for use in
/// the Cloud.
#[allow(missing_docs)]
#[derive(Clone,Debug,Deserialize,Eq,Hash,PartialEq,Serialize)]
#[serde(rename_all="camelCase")]
pub struct ContentRoot {
pub id:Uuid,
#[serde(rename="type")]
pub content_root_type : ContentRootType,
pub name : String,
#[serde(tag="type")]
pub enum ContentRoot {
/// Points to the project home.
#[serde(rename_all="camelCase")]
Project {
id : Uuid,
},
/// This content root points to the system root (`/`) on unix systems, or to a drive root on
/// Windows. In Windows' case, there may be multiple `Root` entries corresponding to the various
/// drives.
#[serde(rename_all="camelCase")]
FileSystemRoot {
id : Uuid,
path : String,
},
/// The user's home directory
#[serde(rename_all="camelCase")]
Home {
id : Uuid,
},
/// An Enso library location.
#[serde(rename_all="camelCase")]
Library {
id : Uuid,
namespace : String,
name : String,
version : String,
},
/// A content root that has been added by the IDE.
#[serde(rename_all="camelCase")]
Custom {
id : Uuid,
}
}

impl ContentRoot {
/// The content root's id.
pub fn id(&self) -> Uuid {
match self {
ContentRoot::Project {id } => *id,
ContentRoot::FileSystemRoot {id,..} => *id,
ContentRoot::Home {id } => *id,
ContentRoot::Library {id,..} => *id,
ContentRoot::Custom {id } => *id,
}
}
}


Expand Down
92 changes: 62 additions & 30 deletions src/rust/ide/lib/enso-protocol/src/project_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,18 @@ impl From<ProjectName> for String {

/// Project information, such as name, its id and last time it was opened.
#[derive(Debug,Clone,Serialize,Deserialize,PartialEq)]
#[serde(rename_all="camelCase")]
pub struct ProjectMetadata {
/// Project's name.
pub name : ProjectName,
pub name:ProjectName,
/// Project's namespace,
pub namespace:String,
/// Project's uuid.
pub id : Uuid,
pub id:Uuid,
/// Engine version to use for the project, represented by a semver version string.
pub engine_version:String,
/// Last time the project was opened.
pub last_opened : Option<UTCDateTime>
pub last_opened:Option<UTCDateTime>
}

/// This type specifies what action should be taken if an Engine's component required to complete
Expand Down Expand Up @@ -167,11 +172,15 @@ pub mod response {
#[serde(rename_all="camelCase")]
pub struct OpenProject {
/// The version of the started language server represented by a semver version string.
pub engine_version : String,
pub engine_version:String,
/// Address of the endpoint for JSON-RPC communication.
pub language_server_json_address : IpWithSocket,
pub language_server_json_address:IpWithSocket,
/// Address of the endpoint for binary FlatBuffers communication.
pub language_server_binary_address : IpWithSocket,
pub language_server_binary_address:IpWithSocket,
/// The name of the project as it is opened.
pub project_name:ProjectName,
/// The namespace of the project.
pub project_namespace:String,
}
}

Expand Down Expand Up @@ -218,6 +227,8 @@ mod mock_client_tests {
engine_version : "0.2.1".to_owned(),
language_server_json_address : language_server_address.clone(),
language_server_binary_address : language_server_address,
project_name : ProjectName::new("Test"),
project_namespace : "local".to_owned(),
};
let open_result = Ok(expected_open_result.clone());
let missing_component_action = MissingComponentAction::Fail;
Expand Down Expand Up @@ -255,25 +266,33 @@ mod mock_client_tests {
fn list_projects() {
let mock_client = MockClient::default();
let project1 = ProjectMetadata {
name : ProjectName::new("project1"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-01-07T21:25:26Z").unwrap())
name : ProjectName::new("project1"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-01-07T21:25:26Z").unwrap()),
engine_version : "0.2.21".to_owned(),
namespace : "local".to_owned(),
};
let project2 = ProjectMetadata {
name : ProjectName::new("project2"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-02-02T13:15:20Z").unwrap())
last_opened : Some(DateTime::parse_from_rfc3339("2020-02-02T13:15:20Z").unwrap()),
engine_version : "0.2.22".to_owned(),
namespace : "local".to_owned(),
};
let expected_recent_projects = response::ProjectList { projects : vec![project1,project2] };
let sample1 = ProjectMetadata {
name : ProjectName::new("sample1"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2019-11-23T05:30:12Z").unwrap())
name : ProjectName::new("sample1"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2019-11-23T05:30:12Z").unwrap()),
engine_version : "0.2.21".to_owned(),
namespace : "test".to_owned(),
};
let sample2 = ProjectMetadata {
name : ProjectName::new("sample2"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2019-12-25T00:10:58Z").unwrap())
name : ProjectName::new("sample2"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2019-12-25T00:10:58Z").unwrap()),
engine_version : "0.2.21".to_owned(),
namespace : "test".to_owned(),
};
let expected_sample_projects = response::ProjectList { projects : vec![sample1,sample2] };
expect_call!(mock_client.list_projects(count=Some(2)) =>
Expand Down Expand Up @@ -370,8 +389,11 @@ mod remote_client_tests {
let engine_version = "0.2.1".to_owned();
let language_server_json_address = IpWithSocket{host:"localhost".to_string(),port:27015};
let language_server_binary_address = IpWithSocket{host:"localhost".to_string(),port:27016};
let project_name = ProjectName::new("Test");
let project_namespace = "test_ns".to_owned();
let open_result = response::OpenProject {engine_version
,language_server_json_address,language_server_binary_address};
,language_server_json_address,language_server_binary_address,project_name
,project_namespace};
let open_result_json = json!({
"engineVersion" : "0.2.1",
"languageServerJsonAddress" : {
Expand All @@ -381,7 +403,9 @@ mod remote_client_tests {
"languageServerBinaryAddress" : {
"host" : "localhost",
"port" : 27016
}
},
"projectName" : "Test",
"projectNamespace" : "test_ns",
});
let project_name = String::from("HelloWorld");
let project_create_json = json!({
Expand All @@ -393,27 +417,35 @@ mod remote_client_tests {
let number_of_projects_json = json!({"numberOfProjects":number_of_projects});
let num_projects_json = json!({"numProjects":number_of_projects});
let project1 = ProjectMetadata {
name : ProjectName::new("project1"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-01-07T21:25:26Z").unwrap())
name : ProjectName::new("project1"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-01-07T21:25:26Z").unwrap()),
engine_version : "0.2.21".to_owned(),
namespace : "local".to_owned(),
};
let project2 = ProjectMetadata {
name : ProjectName::new("project2"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-02-02T13:15:20Z").unwrap())
name : ProjectName::new("project2"),
id : Uuid::default(),
last_opened : Some(DateTime::parse_from_rfc3339("2020-02-02T13:15:20Z").unwrap()),
engine_version : "0.2.22".to_owned(),
namespace : "local".to_owned(),
};
let project_list = response::ProjectList { projects : vec![project1,project2] };
let project_list_json = json!({
"projects" : [
{
"id" : "00000000-0000-0000-0000-000000000000",
"last_opened" : "2020-01-07T21:25:26+00:00",
"name" : "project1"
"id" : "00000000-0000-0000-0000-000000000000",
"lastOpened" : "2020-01-07T21:25:26+00:00",
"name" : "project1",
"engineVersion" : "0.2.21",
"namespace" : "local"
},
{
"id" : "00000000-0000-0000-0000-000000000000",
"last_opened" : "2020-02-02T13:15:20+00:00",
"name" : "project2"
"id" : "00000000-0000-0000-0000-000000000000",
"lastOpened" : "2020-02-02T13:15:20+00:00",
"name" : "project2",
"engineVersion" : "0.2.22",
"namespace" : "local"
}
]
});
Expand Down
2 changes: 1 addition & 1 deletion src/rust/ide/lib/parser/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::path::PathBuf;
const PARSER_PATH: &str = "./pkg/scala-parser.js";

/// Commit from `enso` repository that will be used to obtain parser from.
const PARSER_COMMIT: &str = "e53ee305d18d070c715205ba4a5758f53b4ef23b";
const PARSER_COMMIT: &str = "44ef29a3b70ccada491ac71e199f323211c997d3";

/// Magic code that needs to be prepended to ScalaJS generated parser due to:
/// https://github.com/scala-js/scala-js/issues/3677/
Expand Down
6 changes: 4 additions & 2 deletions src/rust/ide/lib/parser/tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn import_utilities() {
let parser = Parser::new_or_panic();
let expect_import = |code:&str| {
let ast = parser.parse_line(code).unwrap();
assert!(is_ast_import(&ast));
assert!(is_ast_import(&ast), "Not Ast import: {:?}", ast);
let ast_match = ast_as_import_match(&ast).unwrap();
assert_eq!(&ast,ast_match.ast());
assert!(is_match_import(&ast_match));
Expand All @@ -29,10 +29,12 @@ fn import_utilities() {

expect_import("import");
expect_import("import Foo");
expect_import("import foo.Foo.Bar");
expect_import("import foo.Foo.Bar");
expect_import("import Foo.Bar");
expect_import("import Foo.Bar.Baz");
expect_import("from Foo import Bar");
expect_import("from Foo import all hiding Bar");
expect_import("from foo.Foo import all hiding Bar");
expect_import("from Base.Data.List import all hiding Cons, Nil");

expect_not_import("type Foo");
Expand Down
1 change: 0 additions & 1 deletion src/rust/ide/lib/parser/tests/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ impl Fixture {
let macro_usages = vec!
[ "[]", "[1,2,3]"
, "{x}"
, "unsafe x", "private x"
, "polyglot java import com.example.MyClass"
, "foo -> bar"
, "()"
Expand Down
Loading

0 comments on commit 3031f4a

Please sign in to comment.