diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..82501ea72e6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,18 @@ +[submodule "rls-vfs"] + path = vfs + url = git@github.com:nrc/rls-vfs.git +[submodule "vscode"] + path = vscode + url = git@github.com:rust-lang-nursery/rls-vscode.git +[submodule "span"] + path = span + url = git@github.com:nrc/rls-span.git +[submodule "data"] + path = data + url = git@github.com:nrc/rls-data.git +[submodule "analysis"] + path = analysis + url = git@github.com:nrc/rls-analysis.git +[submodule "languageserver-types"] + path = languageserver-types + url = git@github.com:gluon-lang/languageserver-types.git diff --git a/Cargo.lock b/Cargo.lock index 47f1c738b25..227d423fa5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,24 +1,9 @@ [root] -name = "rls" -version = "0.1.0" +name = "rls-vfs" +version = "0.4.3" dependencies = [ - "cargo 0.21.0 (git+https://github.com/rust-lang/cargo)", - "derive-new 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "languageserver-types 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "racer 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rls-analysis 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rls-data 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rls-vfs 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustfmt-nightly 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -402,7 +387,6 @@ dependencies = [ [[package]] name = "languageserver-types" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -645,10 +629,32 @@ name = "regex-syntax" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rls" +version = "0.1.0" +dependencies = [ + "cargo 0.21.0 (git+https://github.com/rust-lang/cargo)", + "derive-new 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "languageserver-types 0.11.0", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "racer 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rls-analysis 0.4.1", + "rls-data 0.7.0", + "rls-span 0.4.0", + "rls-vfs 0.4.3", + "rustfmt-nightly 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rls-analysis" version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "derive-new 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -660,16 +666,20 @@ dependencies = [ [[package]] name = "rls-data" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rls-data" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +replace = "rls-data 0.7.0" + [[package]] name = "rls-span" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -677,13 +687,10 @@ dependencies = [ ] [[package]] -name = "rls-vfs" -version = "0.4.3" +name = "rls-span" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "racer 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +replace = "rls-span 0.4.0" [[package]] name = "rustc-demangle" @@ -1127,7 +1134,6 @@ dependencies = [ "checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" "checksum jobserver 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4e28adc987f6d0521ef66ad60b055968107b164b3bb3cf3dc8474e0a380474a6" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum languageserver-types 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c178b944c3187527293fb9f8a0b0db3c5fb62eb127cacd65296f651a2440f5b1" "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" "checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" "checksum libgit2-sys 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "df18a822100352d9863b302faf6f8f25c0e77f0e60feb40e5dbe1238b7f13b1d" @@ -1156,10 +1162,8 @@ dependencies = [ "checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" -"checksum rls-analysis 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "78a05b130793ebc781c2d933299d7214a10d014fdebe5184eb652c81ba8d3184" "checksum rls-data 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e502ac679bc35e023e982506c32d0278ef89e29af1e4ad21cb70c44b525b87a9" "checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a" -"checksum rls-vfs 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1f19246a0fda45f2fb6eb34addef2a692c044cbf1c90ec7695583450fb5f23e7" "checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustfmt-nightly 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "14b96be9392b91205ddaf5e6ecb38e087db815f8cd3ba14a0ee7c680107d4546" diff --git a/Cargo.toml b/Cargo.toml index bdaba833748..c70bd80deb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1 +1,13 @@ [workspace] +members = [ + "rls", + "vfs", + "analysis", + "data", + "span", + "languageserver-types", +] + +[replace] +"rls-data:0.7.0" = { path = "data" } +"rls-span:0.4.0" = { path = "span" } diff --git a/README.md b/README.md index 217328f1d7b..a22e7264d05 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ better experience for larger and larger crates. The RLS is designed to be frontend-independent. We hope it will be widely adopted by different editors and IDEs. To seed development, we provide a -[reference implementation of an RLS frontend](https://github.com/jonathandturner/rls_vscode) -for [Visual Studio Code](https://code.visualstudio.com/). +[reference implementation of an RLS frontend](https://github.com/rust-lang-nursery/rls-vscode) +(and included in this repo as a submodule) for [Visual Studio Code](https://code.visualstudio.com/). ## Setup @@ -75,13 +75,12 @@ Next, you'll need to run the VSCode extension (for this step, you'll need a recent [node](https://nodejs.org/en/) installed: ``` -git clone https://github.com/rust-lang-nursery/rls_vscode -cd rls_vscode +cd vscode npm install code . ``` -VSCode will open into the `rls_vscode` project. From here, click the Debug +VSCode will open into the `vscode` project. From here, click the Debug button on the left-hand side (a bug with a line through it). Next, click the green triangle at the top. This will launch a new instance of VSCode with the `rls_vscode` plugin enabled. VSCode setting `"window.openFoldersInNewWindow"` diff --git a/analysis b/analysis new file mode 160000 index 00000000000..da75bafcee1 --- /dev/null +++ b/analysis @@ -0,0 +1 @@ +Subproject commit da75bafcee158f1769baa8b79509657bea263ec5 diff --git a/contributing.md b/contributing.md index c8dff0cd88e..9cd1b71f2ee 100644 --- a/contributing.md +++ b/contributing.md @@ -20,7 +20,7 @@ please get in touch by filing an issue or on IRC. ## Building -Note, you also don't need to build the `rls` to use it. Instead, you can install +Note, you don't need to build the `rls` to use it. Instead, you can install via `rustup`, which is the currently preferred method. See the [readme](README.md) for more information. @@ -43,6 +43,10 @@ cd rls cargo build --release ``` +After cloning or updating, if you have missing or out of date crates, you might +need to update the submodules, try `git submodule update --init`. + + ### Step 3: Connect the RLS to your compiler If you're using recent versions of rustup, you will also need to make sure that @@ -108,7 +112,7 @@ cargo run Though more commonly, you'll use an IDE plugin to invoke it for you (see [README.md](README.md) for details). -We recommend using https://github.com/jonathandturner/rls_vscode in VSCode. If +We recommend using https://github.com/rust-lang-nursery/rls-vscode in VSCode. If you are debugging you should set `HIDE_WINDOW_OUTPUT` to `false`, this will send logging and other messages to the extensions panel in VSCode. Anything the RLS writes to stderr is redirected to VSCode. Do not write to stdout, that will @@ -243,8 +247,8 @@ The RLS tracks changes to files, and keeps the changed file in memory (i.e., the RLS does not need the IDE to save a file before providing data). These changed files are tracked by the 'Virtual File System' (which is a bit of a grandiose name for a pretty simple file cache at the moment, but I expect this area to -grow significantly in the future). The VFS is in a [separate -crate](https://github.com/nrc/rls-vfs). +grow significantly in the future). The VFS is in a its own crate in the `vfs` +directory. We want to start building before the user needs information (it would be too slow to start a build when data is requested). However, we don't want to start a @@ -275,7 +279,7 @@ reference and store this data in HashMaps and use it to look up data for the IDE. Reading, processing, and storing the analysis data is handled by the -[rls-analysis crate](https://github.com/nrc/rls-analysis). +rls-analysis crate (in the `analysis` directory). ### Communicating with IDEs @@ -296,12 +300,12 @@ the RLS. ### Extensions to the Language Server Protocol -The RLS uses some custom extensions to the Language Server Protocol. Currently -these are all sent from the RLS to an LSP client and are only used to improve -the user experience by showing progress indicators. +The RLS uses some custom extensions to the Language Server Protocol. -* `rustDocument/diagnosticsBegin`: notification, no arguments. Sent before a - build starts and before any diagnostics from a build are sent. -* `rustDocument/diagnosticsEnd`: notification, no arguments. Sent when a build - is complete (successfully or not, or even skipped) and all post-build analysis - by the RLS is complete. +* `rustDocument/diagnosticsBegin`: notification, no arguments. Sent from the RLS + to a client before a build starts and before any diagnostics from a build are sent. +* `rustDocument/diagnosticsEnd`: notification, no arguments. Sent from the RLS + to a client when a build is complete (successfully or not, or even skipped) + and all post-build analysis by the RLS is complete. +* `rustWorkspace/deglob`: message sent from the client to the RLS to initiate a + deglob refactoring. diff --git a/data b/data new file mode 160000 index 00000000000..b6159dd1171 --- /dev/null +++ b/data @@ -0,0 +1 @@ +Subproject commit b6159dd11713359457724f9dda1e7fef18939bb0 diff --git a/languageserver-types b/languageserver-types new file mode 160000 index 00000000000..1c2a202a99d --- /dev/null +++ b/languageserver-types @@ -0,0 +1 @@ +Subproject commit 1c2a202a99d309c27da9a24768bd17ba5a38376c diff --git a/rls/Cargo.toml b/rls/Cargo.toml index 8079ce996cf..b7a8a41e9c0 100644 --- a/rls/Cargo.toml +++ b/rls/Cargo.toml @@ -13,13 +13,13 @@ build = "build.rs" cargo = { git = "https://github.com/rust-lang/cargo" } derive-new = "0.3" env_logger = "0.4" -languageserver-types = "0.11.0" +languageserver-types = { path = "../languageserver-types" } log = "0.3" racer = "2.0.6" -rls-analysis = "0.4.1" -rls-data = "= 0.7" -rls-span = { version = "0.4", features = ["serialize-serde"] } -rls-vfs = { version = "0.4", features = ["racer-impls"] } +rls-analysis = { path = "../analysis" } +rls-data = { path = "../data" } +rls-span = { path = "../span" , features = ["serialize-serde"] } +rls-vfs = { path = "../vfs", features = ["racer-impls"] } rustfmt-nightly = "0.1" serde = "1.0" serde_json = "1.0" diff --git a/span b/span new file mode 160000 index 00000000000..af9343e818d --- /dev/null +++ b/span @@ -0,0 +1 @@ +Subproject commit af9343e818d5d7e39bb35e3b78ddc0124e7a841f diff --git a/vfs b/vfs new file mode 160000 index 00000000000..0e6f75b03b5 --- /dev/null +++ b/vfs @@ -0,0 +1 @@ +Subproject commit 0e6f75b03b5440a93d455aac231674baddea0331 diff --git a/vscode b/vscode new file mode 160000 index 00000000000..90a01c83c69 --- /dev/null +++ b/vscode @@ -0,0 +1 @@ +Subproject commit 90a01c83c6942b240dad8b53d83a79631437d706