Skip to content
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

Support .toml file extension on .cargo/config #7273

Closed
anp opened this issue Aug 20, 2019 · 3 comments · Fixed by #7295
Closed

Support .toml file extension on .cargo/config #7273

anp opened this issue Aug 20, 2019 · 3 comments · Fixed by #7295
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@anp
Copy link
Member

anp commented Aug 20, 2019

Describe the problem you are trying to solve

To have syntax highlighting in VSCode I currently create a custom file association in my settings:

    "files.associations": {
        "**/.cargo/config": "toml"
    },

I'd love to not have to do this!

Describe the solution you'd like

Could cargo accept .cargo/config.toml as a path for local configuration?

Notes

There are many alternatives available, like making the Rust editor plugins aware of this association. However, cargo's usage of TOML elsewhere is identified by the file extension (consistency), and this change would presumably improve ergonomics in other places that do syntax highlighting, not just in editors (availability).

@anp anp added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Aug 20, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Aug 20, 2019

We should just change our docs to show config.toml everywhere and support both config and config.toml for backwards compat. Noone will be affected and everyone can update as they please.

@fluffysquirrels
Copy link
Contributor

What do we do where both config and config.toml exist? How about issuing a warning and defaulting to config? My preference leans toward issuing an error if both exist, but this is a breaking change affecting people that already have both for some reason.

@anp
Copy link
Member Author

anp commented Aug 21, 2019

I agree re: an error being a weird change for someone who had both paths available.

Defaulting to config on conflict sounds great to me, since it matches the behavior someone with both files would already have observed. Printing a warning also sounds great to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants