question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion - quick action to expand dependency specification in Cargo.toml

See original GitHub issue

When adding dependencies to my Cargo.toml, it’s handy that the latest version is provided as a completion. However, it’s still a bit annoying to type out the dependency specifications when the dependency needs to be configured with additional options, like default_features = false or features = [ "serde" ]. It would be handy to have an action that expands the shorter syntax to the full syntax, placing the cursor before the closing bracket so additional options can be added - replacing serde = "1.0" with serde = { version = "1.0" }

Intentions

  • Expand key-value specification into inline table (#6960)
  • Extract inline table to separate table (#7003)
  • Move separate dependency table into inline table
  • Simplify separate table/inline table into key-value if there is only version key (#7559)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Undincommented, May 23, 2020

@Kobzol actually, I already have a prototype of this feature so I don’t think we should make it twice I’ll try to finish it soon

0reactions
blaenkcommented, Dec 14, 2020

It might be nice to be able to cycle through the three (only?) main ways of representing them:

rusqlite = "0.24.2"
rusqlite = { version = "0.24.2" }
[dependencies.rusqlite]
version = "0.24.2"
Read more comments on GitHub >

github_iconTop Results From Across the Web

The Manifest Format - The Cargo Book
The Cargo.toml file for each package is called its manifest. Every manifest file consists of one or more sections. The [package] section.
Read more >
Specifying Dependencies - The Cargo Book
To specify a dependency from a registry other than crates.io, first the registry must be configured in a .cargo/config.toml file.
Read more >
What's New in IntelliJ Rust for the 2021.2 Release Cycle
There is a new intention action that expands dependency specifications in Cargo.toml, either inline or into a separate table below the current ...
Read more >
IntelliJ Rust Changelog #152
This intention action simplifies the writing of trait impl s. ... #7559 Simplify dependency specification for dependencies in Cargo.toml.
Read more >
Use feature of crate dependency without its declaration in toml
Does this answer your question? How do I 'pass down' feature flags to subdependencies in Cargo? · I don't think so. · It...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found