support Rust LSP server auto-detect some useful root path based on location of Cargo.toml
ClosedPublic

Authored by cullmann on Tue, Aug 6, 10:58 AM.

Diff Detail

Repository
R40 Kate
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cullmann created this revision.Tue, Aug 6, 10:58 AM
Restricted Application added a project: Kate. · View Herald TranscriptTue, Aug 6, 10:58 AM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
cullmann requested review of this revision.Tue, Aug 6, 10:58 AM
univerz added a subscriber: univerz.Tue, Aug 6, 1:38 PM

according to the recent discussion on rust-analyzer (rls 2.0), it's better to look for Cargo.lock - it should work for workspace based projects too.

https://github.com/rust-analyzer/rust-analyzer/issues/1650#issuecomment-518219611

Is it better to search for only the "Cargo.lock" or shall one search just for both and use the first director with a hit?

Is it better to search for only the "Cargo.lock" or shall one search just for both and use the first director with a hit?

disclaimer: i have no expertise in this area :).

this comment is clearer https://github.com/rust-analyzer/rust-analyzer/issues/1650#issuecomment-518088316

it looks like the problem is that search for .toml stops too early, so using both and use first directory with a hit would not work. each project in a workspace have it's own Cargo.toml, but there is only one top-level Cargo.lock.

Hmm, ok, let's wait if there is more input in the rls issue linked here ;=)
I have no issues with changing the file name to the right thing (tm).

Looks fine, so awaiting some input for some details as mentioned I suppose ...

I will already commit a bit simplified version, I guess the pattern is overkill (and slow for large directories).
Later we can tweak this further, at least for me this make rls at all usable.

This revision was not accepted when it landed; it landed in state Needs Review.Wed, Aug 7, 6:52 PM
This revision was automatically updated to reflect the committed changes.