aboutsummaryrefslogtreecommitdiff
path: root/ROADMAP.md
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-06 13:12:57 +0000
committerAleksey Kladov <[email protected]>2018-11-06 13:12:57 +0000
commitf0bcb09b5e5e34810c302caff94d9bf911ee3ebc (patch)
tree9ae5a50b3b25416ae1dd227b0b5d81726086269e /ROADMAP.md
parentd1b242262a6617b22140bddd0bed23115c260e74 (diff)
Add roadmap
Diffstat (limited to 'ROADMAP.md')
-rw-r--r--ROADMAP.md74
1 files changed, 74 insertions, 0 deletions
diff --git a/ROADMAP.md b/ROADMAP.md
new file mode 100644
index 000000000..05fad38ec
--- /dev/null
+++ b/ROADMAP.md
@@ -0,0 +1,74 @@
1# Rust Analyzer Roadmap 01
2
3Written on 2018-11-06, extends approximately to February 2019.
4After, we should coordinate with rustc/RLS developers to align goals and share code and experience.
5
6
7# Overall Goals
8
9The mission is:
10 * provide an excellent "code analyzed as you type" IDE experience for the Rust language,
11 * implementing the bulk of the features in Rust itself.
12
13
14High-level architecture constraints:
15 * Aim, long-term, to use the single code base with rustc.
16 It's *obvious* then the code should be shared, but OTOH, all great IDEs started as from-scratch rewrites.
17 * Don't hard-code a particular protocol or mode of operation.
18 Produce a library which could be used for implementing an LSP server, or for in-process embedding.
19 * As long as possible, stick with stable Rust (NB: we currently use beta for 2018 edition and salsa).
20
21
22# Current Goals
23
24We really should be coordinating with compiler/rls teams, but they are busy working on making Rust 2018 at the moment.
25The sync-up point will happen some time after the edition, probably early next year.
26In the mean time, the goal is to **experiment**, specifically, to figure out how a from-scratch written RLS might look like.
27
28
29## Data Storage and Protocol implementation
30
31The fundamental part of any architecture is who owned what data, how the data is mutated and how the data is exposed to user.
32For storage we use the [salsa](http://github.com/salsa-rs/salsa) library, and the model already seems solid.
33
34Most of modification is driven by the language client, but we also should support watching the file system, current implementation is a stub.
35
36**Action Item:** implement reliable file watching service.
37
38We also should extract LSP bits as a reusable library. There's already `gen_lsp_server`, but it is pretty limited.
39
40**Action Item:** try using `gen_lsp_server` in more than one language server, for example for TOML and Nix.
41
42Note that it is unclear what shape is ideal for `gen_lsp_server`.
43I'd rather avoid futures: they bring significant runtime complexity (call stacks become insane), but we don't have c10k problem to solve.
44Current interface is based on crossbeam-channel, but it's not clear if that is the best choice.
45
46
47## Low-effort, high payoff features
48
49Implementing 20% of type inference will give use 80% of completion.
50Thus it makes sense to try to get some name resolution, type inference and trait matching implemented, even if all this code will be removed when we start sharing code with compiler.
51
52Specifically, we need to:
53
54**Action Item:** implement path resolution, so that we get completion in imports and such.
55**Action Item:** implement simple type inference, so that we get completion for inherent methods.
56**Action Item:** implement nicer completion infrastructure, so that we have icons, snippets, doc comments, after insert callbacks, ...
57
58
59## Dragons to kill
60
61To make experiments most effective, we should try to prototype solutions for the hardest problems.
62In case of Rust, the two hardest problems are:
63 * Conditional compilation and source/model mismatch.
64 A single source file might correspond to several entities in the semantic model.
65 For example, different cfg flags produce effectively different crates from the same source.
66 * Macros are intertwined with name resolution in a single fix-point iteration algorithm.
67 This is just plain hard to implement, but also interacts poorly with on-demand.
68
69
70For the first bullet point, we need to design descriptors infra and explicit mapping step between sources and semantic model, which is intentionally fuzzy in one direction.
71The action item here is basically "write code, see what works, keep high-level picture in mind".
72
73For the second bullet point there's hope that salsa with its deep memorization will give us fast enough solution even without full on-demand.
74Again, action item is to write the code and see what works. Salsa itself uses macros heavily, so it should be a great test.