rust-lang / rls

Repository for the Rust Language Server (aka RLS)
Other
3.52k stars 257 forks source link

chore: Upgrade cargo #1764

Closed epage closed 2 years ago

epage commented 2 years ago

Cargo has switched exclusively to toml_edit, so when downcasting errors to get line and column, we need to downcast for those errors as well.

This does not attempt to port rls to toml_edit and an analysis was not done to verify if the find_toml_error code path only needs to check for one toml library.

The downside to this solution is its brittle. Any time cargo upgrades through a breaking toml_edit version, this test will break again and we'll have to upgrade rls to fix it.

The tracking of manifest_error_range was changed because I was originally exploring removing it. Returning None didn't change the test to fail in a way I expected, so I pivoted to get line_col into toml_edit. I felt the change did make the code better match intent and since it was a distinct commit, I kept it here. I can remove it if needed.