From 50357acd5545b58c1105516b81599d64b27d41d9 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 3 May 2020 21:38:36 -0400 Subject: [PATCH] Add editor/ crate --- Cargo.lock | 35 +++++++++++++++++++++++++++++ Cargo.toml | 1 + editor/Cargo.toml | 57 +++++++++++++++++++++++++++++++++++++++++++++++ editor/src/lib.rs | 8 +++++++ 4 files changed, 101 insertions(+) create mode 100644 editor/Cargo.toml create mode 100644 editor/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 8a2287dd0d..3a70fe4c5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1065,6 +1065,7 @@ dependencies = [ "roc_can", "roc_collections", "roc_constrain", + "roc_editor", "roc_gen", "roc_load", "roc_module", @@ -1152,6 +1153,40 @@ dependencies = [ "roc_uniq", ] +[[package]] +name = "roc_editor" +version = "0.1.0" +dependencies = [ + "bumpalo", + "im", + "im-rc", + "indoc", + "inkwell", + "inlinable_string", + "maplit", + "pretty_assertions", + "quickcheck", + "quickcheck_macros", + "roc_builtins", + "roc_can", + "roc_collections", + "roc_constrain", + "roc_gen", + "roc_load", + "roc_module", + "roc_mono", + "roc_parse", + "roc_problem", + "roc_region", + "roc_reporting", + "roc_solve", + "roc_types", + "roc_unify", + "roc_uniq", + "target-lexicon", + "tokio", +] + [[package]] name = "roc_fmt" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index f180dadbf0..6779427ab3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ members = [ "vendor/ena", "vendor/pathfinding", "vendor/pretty", + "editor", "cli" ] diff --git a/editor/Cargo.toml b/editor/Cargo.toml new file mode 100644 index 0000000000..7ac7ff6213 --- /dev/null +++ b/editor/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "roc_editor" +version = "0.1.0" +authors = ["Richard Feldman "] +edition = "2018" +description = "An editor for Roc" +license = "Apache-2.0" + +[dependencies] +roc_collections = { path = "../compiler/collections" } +roc_can = { path = "../compiler/can" } +roc_parse = { path = "../compiler/parse" } +roc_region = { path = "../compiler/region" } +roc_module = { path = "../compiler/module" } +roc_problem = { path = "../compiler/problem" } +roc_types = { path = "../compiler/types" } +roc_builtins = { path = "../compiler/builtins" } +roc_constrain = { path = "../compiler/constrain" } +roc_uniq = { path = "../compiler/uniq" } +roc_unify = { path = "../compiler/unify" } +roc_solve = { path = "../compiler/solve" } +roc_mono = { path = "../compiler/mono" } +roc_load = { path = "../compiler/load" } +roc_gen = { path = "../compiler/gen" } +roc_reporting = { path = "../compiler/reporting" } + # TODO switch to clap 3.0.0 once it's out. Tried adding clap = "~3.0.0-beta.1" and cargo wouldn't accept it +im = "14" # im and im-rc should always have the same version! +im-rc = "14" # im and im-rc should always have the same version! +bumpalo = { version = "3.2", features = ["collections"] } +inlinable_string = "0.1.0" +tokio = { version = "0.2", features = ["blocking", "fs", "sync", "rt-threaded", "process", "io-driver"] } +# NOTE: rtfeldman/inkwell is a fork of TheDan64/inkwell which does not change anything. +# +# The reason for this fork is that the way Inkwell is designed, you have to use +# a particular branch (e.g. "llvm8-0") in Cargo.toml. That would be fine, except that +# breaking changes get pushed directly to that branch, which breaks our build +# without warning. +# +# We tried referencing a specific rev on TheDan64/inkwell directly (instead of branch), +# but although that worked locally, it did not work on GitHub Actions. (After a few +# hours of investigation, gave up trying to figure out why.) So this is the workaround: +# having an immutable tag on the rtfeldman/inkwell fork which points to +# a particular "release" of Inkwell. +# +# When we want to update Inkwell, we can sync up rtfeldman/inkwell to the latest +# commit of TheDan64/inkwell, push a new tag which points to the latest commit, +# change the tag value in this Cargo.toml to point to that tag, and `cargo update`. +# This way, GitHub Actions works and nobody's builds get broken. +inkwell = { git = "https://github.com/rtfeldman/inkwell", tag = "llvm10-0.release1" } +target-lexicon = "0.10" + +[dev-dependencies] +pretty_assertions = "0.5.1" +maplit = "1.0.1" +indoc = "0.3.3" +quickcheck = "0.8" +quickcheck_macros = "0.8" diff --git a/editor/src/lib.rs b/editor/src/lib.rs new file mode 100644 index 0000000000..51017b3949 --- /dev/null +++ b/editor/src/lib.rs @@ -0,0 +1,8 @@ +use std::io; + +/// The editor is actually launched from the CLI if you pass it zero arguments. +pub fn launch() -> io::Result<()> { + println!("TODO launch the editor."); + + Ok(()) +}