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

API update to support the newly added reexport field. #1718

Open
wants to merge 10 commits into
base: wip/ao/api-update
Choose a base branch
from
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Next Release

This update contains major performance improvements and exposes new privacy user
settings. We will work towards stabilizing it in the next weeks in order to make
these updates be shipped in a stable release before the end of the year.

<br/>![New Features](/docs/assets/tags/new_features.svg)

#### Enso Compiler

- [Updated Enso engine to version 0.2.14][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.8 (2021-06-09)

<br/>![New Features](/docs/assets/tags/new_features.svg)
Expand Down
2 changes: 1 addition & 1 deletion 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.14'
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
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.14'
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: 0 additions & 1 deletion src/rust/ensogl/lib/components/src/selector/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ mod tests {
use enso_frp::io::mouse::Button;
use enso_frp::stream::EventEmitter;
use enso_frp::stream::ValueProvider;
use float_eq::assert_float_eq;

#[test]
fn test_shape_is_dragged() {
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
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
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
91 changes: 65 additions & 26 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 Expand Up @@ -796,6 +820,15 @@ pub enum SuggestionEntryType {Atom,Method,Function,Local}
#[serde(tag="type")]
#[serde(rename_all="camelCase")]
pub enum SuggestionEntry {
#[serde(rename_all="camelCase")]
Module {
/// The fully qualified module name.
module : String,
/// The documentation string.
documentation : Option<String>,
/// The module name re-exporting this module.
reexport : Option<String>,
},
#[serde(rename_all="camelCase")]
Atom {
external_id : Option<Uuid>,
Expand All @@ -804,6 +837,8 @@ pub enum SuggestionEntry {
arguments : Vec<SuggestionEntryArgument>,
return_type : String,
documentation : Option<String>,
/// The module name re-exporting this atom.
reexport : Option<String>,
},
#[serde(rename_all="camelCase")]
Method {
Expand All @@ -814,6 +849,8 @@ pub enum SuggestionEntry {
self_type : String,
return_type : String,
documentation : Option<String>,
/// The module name re-exporting this method.
reexport : Option<String>,
},
#[serde(rename_all="camelCase")]
Function {
Expand All @@ -838,10 +875,11 @@ impl SuggestionEntry {
/// Get name of the suggested entity.
pub fn name(&self) -> &String {
match self {
Self::Atom {name,..} => name,
Self::Function {name,..} => name,
Self::Local {name,..} => name,
Self::Method {name,..} => name,
Self::Module {module,..} => module,
Self::Atom {name,..} => name,
Self::Function {name,..} => name,
Self::Local {name,..} => name,
Self::Method {name,..} => name,
}
}
}
Expand Down Expand Up @@ -970,6 +1008,7 @@ pub struct SuggestionsDatabaseModification {
pub return_type : Option<FieldUpdate<String>>,
pub documentation : Option<FieldUpdate<String>>,
pub scope : Option<FieldUpdate<SuggestionEntryScope>>,
pub reexport : Option<FieldUpdate<String>>,
}

/// Notification about change in the suggestions database.
Expand Down
Loading