Open nrc opened 6 years ago
@johshoff hey, did you look into this? Did you get far? Anything I can do to help?
Hi, @nrc ! Unfortunately I didn't get very far on this; so far I've only read code. I will be pretty busy going forward, so I wouldn't be upset if anyone else grabs this. If not, though, I will work on this for the second installment of Portland's impl party.
I do have a question, though: It looks like completions are done exclusively by racer. What's the plan for that going forward? Move piece by piece over to rls-analysis?
I do have a question, though: It looks like completions are done exclusively by racer. What's the plan for that going forward? Move piece by piece over to rls-analysis?
There might be other bits and pieces that we can do in the RLS (like the use
thing here), but I don't know any off the top of my head. The grand plan is that we out-source all code completion to the compiler, but that requires a fair bit of work in the compiler to achieve, not least evolving incremental compilation to the point that we can get 'instant' results for a code completion query.
It occurs to me that we could have very quick, perfect code completion for
use
without using the compiler. If we knew we were in ause
expression, then we could use the tree of defs to suggest possible imports. We'd have to be a bit clever to handleself
andsuper
, but otherwise this should be fairly straightforward and fast because we wouldn't need to go to the compiler.