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

Add a high-level overview of the RLS #1257

Merged
merged 7 commits into from
Jan 25, 2019
Merged

Conversation

Xanewok
Copy link
Member

@Xanewok Xanewok commented Jan 23, 2019

This is the initial draft, which serves as reading material for the upcoming IDE discussion at Rust All-Hands.

Reviews, ideas about what could we include and the actual content welcome!

Rendered

Copy link
Contributor

@h-michael h-michael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have nitpicks :)

architecture.md Outdated Show resolved Hide resolved
architecture.md Outdated Show resolved Hide resolved
Copy link
Member

@nrc nrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One general comment: it would be useful to map the abstract descriptions here to modules (or even functions) in the code.

@@ -0,0 +1,174 @@
# Rust Language Server (RLS) - Architecture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link this file from README.md and contributing.md

architecture.md Outdated Show resolved Hide resolved

When initialized, (unless overriden by custom build command) RLS `cargo check`s the current project and collects inter-crate [1] dependency graph along with exact crate compilation invocations, which is used later to run the compiler again itself (but in-process).

In-process compilation runs return populated internal data structures (`rls_data::Analysis`), which are further lowered and cross-referenced to expose a low-level indexing API (`rls_analysis::Analysis`) to finally be consumed by the Rust Language Server in order to answer relevant LSP [2] queries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to say why we do in-process and also when (and why) we do standard out of process build

architecture.md Outdated
This [crate](https://github.com/rust-dev-tools/rls-analysis) is responsible for loading and stitching multiple of
the `rls_data::Analysis` data structures into a single, coherent interface.

Main reason behind that is that each of those structures contains data centric
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another important reason is that rls-analysis is the 'stable' API, whereas the JSON data format can change at any time and should be considered an implementation detail

architecture.md Outdated Show resolved Hide resolved
architecture.md Outdated
build orchestration, and coordination of other components, such as
* Racer for autocompletion
* Cargo for project layout detection and initial build coordination
* internal VFS for handling in-memory text buffers,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spell out VFS here

architecture.md Outdated
* Cargo for project layout detection and initial build coordination
* internal VFS for handling in-memory text buffers,
* rls-analysis serving as our knowledge database

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add Clippy and Rustfmt to the list (and then I think you can remove "etc")

architecture.md Outdated Show resolved Hide resolved
@h-michael
Copy link
Contributor

h-michael commented Jan 25, 2019

If you'd like, I want you to write about the relationship between rls and racer :)

@Xanewok
Copy link
Member Author

Xanewok commented Jan 25, 2019

Thank you for the review!

I'll merge this now so we can easily collaborate on the document together.

@h-michael I'd very much appreciate that, yeah! Mind appending this section to the bottom of the document?

@Xanewok Xanewok merged commit 6acf34e into rust-lang:master Jan 25, 2019
@Xanewok Xanewok deleted the architecture branch January 25, 2019 16:42
bors added a commit to rust-lang/rust that referenced this pull request Feb 2, 2019
submodule: update rls from c9d25b to e2145d

Update rls rust-lang/rls@c9d25b6...e2145d

rust-lang/rls#1276 - h-michael:clippy, r=Xanewok
rust-lang/rls#1269 - rust-lang:dependabot/cargo/rand-0.6.5, r=Xanewok
Remove extra backticks in contributing.md
rust-lang/rls#1267 from h-michael/contributingmd
rust-lang/rls#1268 from matthiaskrgr/rustup
rust-lang/rls#1262 from rust-lang/dependabot/cargo/tokio-0.1.15
rust-lang/rls#1264 - h-michael:pub-crate, r=alexheretic
rust-lang/rls#1261 - rust-lang:dependabot/cargo/tokio-timer-0.2.9, r=Xanewok
rust-lang/rls#1263 - Xanewok:update-clippy, r=Xanewok
rust-lang/rls#1257 from Xanewok/architecture
rust-lang/rls#1258 - rust-lang:dependabot/cargo/lsp-types-0.55.1, r=Xanewok
rust-lang/rls#1255 - Xanewok:you-only-complete-once-fool, r=Xanewok
rust-lang/rls#1252 - rust-lang:dependabot/cargo/cargo_metadata-0.7.0, r=alexheretic
rust-lang/rls#1253 - rust-lang:dependabot/cargo/lsp-types-0.55.0, r=Xanewok
rust-lang/rls#1254 - rust-lang:dependabot/cargo/serde_json-1.0.37, r=Xanewok
dependabot: Explicitly list default allowed_updates
dependabot: Add automerge strategy for clippy_lints
rust-lang/rls#1251 - Xanewok:translate-deglob-test, r=Xanewok
rust-lang/rls#1250 from alexheretic/master
rust-lang/rls#1244 - Xanewok:translate-tests, r=alexheretic
rust-lang/rls#1247 - alexheretic:register-more-clippy, r=Xanewok
rust-lang/rls#1230 - emilio:testing-testing, r=Xanewok
rust-lang/rls#1246 from alexheretic/did-save-manifest
Merge branch 'beta-version-bump' of https://github.com/rust-lang-nursery/rls
bors added a commit to rust-lang/rust that referenced this pull request Feb 3, 2019
submodule: update rls from c9d25b to f331ff7

Update rls rust-lang/rls@c9d25b6...e2145d

rust-lang/rls#1276 - h-michael:clippy, r=Xanewok
rust-lang/rls#1269 - rust-lang:dependabot/cargo/rand-0.6.5, r=Xanewok
Remove extra backticks in contributing.md
rust-lang/rls#1267 from h-michael/contributingmd
rust-lang/rls#1268 from matthiaskrgr/rustup
rust-lang/rls#1262 from rust-lang/dependabot/cargo/tokio-0.1.15
rust-lang/rls#1264 - h-michael:pub-crate, r=alexheretic
rust-lang/rls#1261 - rust-lang:dependabot/cargo/tokio-timer-0.2.9, r=Xanewok
rust-lang/rls#1263 - Xanewok:update-clippy, r=Xanewok
rust-lang/rls#1257 from Xanewok/architecture
rust-lang/rls#1258 - rust-lang:dependabot/cargo/lsp-types-0.55.1, r=Xanewok
rust-lang/rls#1255 - Xanewok:you-only-complete-once-fool, r=Xanewok
rust-lang/rls#1252 - rust-lang:dependabot/cargo/cargo_metadata-0.7.0, r=alexheretic
rust-lang/rls#1253 - rust-lang:dependabot/cargo/lsp-types-0.55.0, r=Xanewok
rust-lang/rls#1254 - rust-lang:dependabot/cargo/serde_json-1.0.37, r=Xanewok
dependabot: Explicitly list default allowed_updates
dependabot: Add automerge strategy for clippy_lints
rust-lang/rls#1251 - Xanewok:translate-deglob-test, r=Xanewok
rust-lang/rls#1250 from alexheretic/master
rust-lang/rls#1244 - Xanewok:translate-tests, r=alexheretic
rust-lang/rls#1247 - alexheretic:register-more-clippy, r=Xanewok
rust-lang/rls#1230 - emilio:testing-testing, r=Xanewok
rust-lang/rls#1246 from alexheretic/did-save-manifest
Merge branch 'beta-version-bump' of https://github.com/rust-lang-nursery/rls
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants