Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Add configuration parameter for changing the target directory. #870

Closed
jonhoo opened this issue May 15, 2018 · 2 comments
Closed

Add configuration parameter for changing the target directory. #870

jonhoo opened this issue May 15, 2018 · 2 comments

Comments

@jonhoo
Copy link

jonhoo commented May 15, 2018

rls currently only allows changing the target build directory through the CARGO_TARGET_DIR environment variable. This is a little unfortunate given that some clients only support sending configuration options, and not other things like changing environment variables. See for example this workaround for LangaugeClient-neovim.

It'd be great if direct support could be added for a target_dir parameter, which changes what target directory is used, and which overrides (or perhaps, is relative to?) CARGO_TARGET_DIR. This is especially important given that cargo and rls step on each other's toes if they operate in the same directory (#866)

@Xanewok
Copy link
Member

Xanewok commented May 15, 2018

It is currently supported by the LSP and the RLS already has this parameter. Language clients need to use the LSP workspace/didChangeConfiguration to pass the rust.target_dir key (See #866 (comment) for more info), so I'm going to close the issue, unless it's not covered by that.

@Xanewok Xanewok closed this as completed May 15, 2018
@jonhoo
Copy link
Author

jonhoo commented May 15, 2018

Ah, this wasn't listed under Configuration in the README. Perhaps that list should be updated accordingly?

Also, is the parameter named rust.target_dir or just target_dir? My understanding was that the rust. prefix is a VSCode-ism?

Separately, I've tried giving target_dir when CARGO_TARGET_DIR is set, and it seems as though the latter is still used. Are you sure that target_dir overrides CARGO_TARGET_DIR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants