Skip to content

More Rust/RLS integration #42146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 86 additions & 34 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ members = [
"tools/rust-installer",
"tools/cargo",
"tools/rls",
# FIXME(https://github.com/rust-lang/cargo/issues/4089): move these to exclude
"tools/rls/test_data/borrow_error",
"tools/rls/test_data/completion",
"tools/rls/test_data/find_all_refs",
"tools/rls/test_data/find_all_refs_no_cfg_test",
"tools/rls/test_data/goto_def",
"tools/rls/test_data/highlight",
"tools/rls/test_data/hover",
"tools/rls/test_data/rename",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to instead specify:

exclude = [
  "tools/rls/test_data",
]

?

(this is a relatively new feature of Cargo)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work - I get "error: failed to read /home/ncameron/rust2/src/tools/rls/test_data/Cargo.toml"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, no I don't. Testing again...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error:

thread '<unnamed>' panicked at 'could not create cargo workspace: current package believes it's in a workspace when it's not:
current:   /home/ncameron/rust2/src/tools/rls/test_data/highlight/Cargo.toml
workspace: /home/ncameron/rust2/src/Cargo.toml

this may be fixable by adding `tools/rls/test_data/highlight` to the `workspace.members` array of the manifest located at: /home/ncameron/rust2/src/Cargo.toml', src/libcore/result.rs:859

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah! Mind opening an issue on Cargo for this so we can be sure to fix it for the next release? And then you can leave a comment here saying # TODO: move these to exclude or something like that for the next release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm this logic makes me think that exclude could work. Are you sure the above doesn't work? I've just added a test case to Cargo locally to and this works as expected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried again after a rebase to Rust master, checked Cargo submod is also on master, and updated system Rust for luck, still get the same error. Note that I get the error on running the RLS tests - so these are test directories inside the RLS directory inside Rust. I wonder if the nesting is exposing a Cargo bug?

"tools/rls/test_data/reformat",
"tools/rls/test_data/bin_lib_no_cfg_test",
"tools/rls/test_data/multiple_bins",
"tools/rls/test_data/bin_lib",
"tools/rls/test_data/reformat_with_range",
]

# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
Expand Down
Loading