Open nrc opened 8 years ago
I'll look into this in the beta timeframe, but I don't think this should block necessarily. I'm not convinced we will see a meaningful perf improvement.
@nrc Is FIXME(#25) still relevant?
If so, how should it be implemented?
Emitter
JsonEmitter
, but append structured Diagnostic
s into an Arc<Mutex<Vec<Diagnostics>>>
to be read later from the emitter itself?Yeah, the error message stuff is still relevant. I haven't thought in details how to fix it. I think that plan sounds reasonable. I'd prefer if we could just move the diagnostics to the RLS, rather that store them in an Arc-Mutex, but I suppose the threading causes issues.
I was thinking of returning owned Vec<Diagnostics>
upwards, but use the Arc-Mutex only to share data across the RLS and rustc threads.
Looking at https://github.com/rust-lang/rust/issues/18579 now, should the Diagnostic
s be in the save-analysis data also?
I don't think they should - we have the information in JSON form, and they are a different kind of data made in a different place in the compiler, so there doesn't seem to be much benefit in combining them for now.
I worked mostly on the rls-analysis front to support multiple packages, but will get back to in a free moment. If someone wants to work on this before I get to it, ping me
Bump: RLS sets RUSTFLAGS just because this, and is causing rebuild for me.
As a note, if we decide to compile out-of-process this wouldn't be a problem anymore.
We are running the compiler in-process, so we should just pass the data, rather than serialising it to JSON and then back again.