@@ -55,12 +55,14 @@ RUST_LOG=debug cargo run -- wallet list
5555#### VS Code
5656
5757Recommended extensions:
58+
5859- ` rust-analyzer ` - Rust language support
5960- ` crates ` - Cargo.toml dependency management
6061- ` Better TOML ` - TOML syntax highlighting
6162- ` Error Lens ` - Inline error display
6263
6364` .vscode/settings.json ` :
65+
6466``` json
6567{
6668 "rust-analyzer.checkOnSave.command" : " clippy" ,
@@ -72,6 +74,7 @@ Recommended extensions:
7274#### IntelliJ IDEA / CLion
7375
7476Install the Rust plugin and configure:
77+
7578- Enable Clippy for code analysis
7679- Set rustfmt as formatter
7780- Enable external linter
@@ -175,7 +178,7 @@ fn private_helper() { /* ... */ }
175178#[cfg(test)]
176179mod tests {
177180 use super :: * ;
178-
181+
179182 #[test]
180183 fn test_something () { /* ... */ }
181184}
@@ -207,13 +210,13 @@ pub fn CreateWallet(Name: String, Encrypt: bool) -> Result<()> {
207210
208211### Naming Conventions
209212
210- | Type | Convention | Example |
211- | ------| ------------| ---------|
212- | Functions | ` snake_case ` | ` fetch_account() ` |
213- | Types | ` PascalCase ` | ` WalletEntry ` |
214- | Constants | ` SCREAMING_SNAKE_CASE ` | ` MAX_RETRIES ` |
215- | Modules | ` snake_case ` | ` hardware_wallet ` |
216- | Lifetimes | ` 'lowercase ` | ` 'a ` , ` 'static ` |
213+ | Type | Convention | Example |
214+ | --------- | ---------------------- | ----------------- |
215+ | Functions | ` snake_case ` | ` fetch_account() ` |
216+ | Types | ` PascalCase ` | ` WalletEntry ` |
217+ | Constants | ` SCREAMING_SNAKE_CASE ` | ` MAX_RETRIES ` |
218+ | Modules | ` snake_case ` | ` hardware_wallet ` |
219+ | Lifetimes | ` 'lowercase ` | ` 'a ` , ` 'static ` |
217220
218221### Error Handling
219222
@@ -239,7 +242,7 @@ let data = load_data()
239242
240243### Documentation
241244
242- ``` rust
245+ ```` rust
243246/// Fetches account information from Horizon API.
244247///
245248/// # Arguments
@@ -267,7 +270,7 @@ let data = load_data()
267270pub fn fetch_account (public_key : & str , network : & str ) -> Result <AccountResponse > {
268271 // Implementation
269272}
270- ```
273+ ````
271274
272275### Comments
273276
@@ -326,17 +329,17 @@ pub fn handle(cmd: MyCommands) -> Result<()> {
326329fn action (input : String ) -> Result <()> {
327330 p :: header (" My Command" );
328331 p :: kv (" Input" , & input );
329-
332+
330333 // Your logic here
331-
334+
332335 p :: success (" Done!" );
333336 Ok (())
334337}
335338
336339#[cfg(test)]
337340mod tests {
338341 use super :: * ;
339-
342+
340343 #[test]
341344 fn test_action () {
342345 // Test your command
@@ -358,7 +361,7 @@ pub mod mycommand;
358361#[derive(Subcommand )]
359362enum Commands {
360363 // ... existing commands
361-
364+
362365 /// My new command
363366 #[command(subcommand)]
364367 MyCommand (commands :: mycommand :: MyCommands ),
@@ -402,7 +405,7 @@ pub fn do_something(input: &str) -> Result<String> {
402405#[cfg(test)]
403406mod tests {
404407 use super :: * ;
405-
408+
406409 #[test]
407410 fn test_do_something () {
408411 let result = do_something (" test" ). unwrap ();
@@ -502,20 +505,20 @@ impl {{PROJECT_NAME_PASCAL}} {
502505#[cfg(test)]
503506mod tests {
504507 use super :: * ;
505-
508+
506509 #[test]
507510 fn test_basic_functionality () {
508511 let result = my_function (" input" );
509512 assert! (result . is_ok ());
510513 assert_eq! (result . unwrap (), " expected" );
511514 }
512-
515+
513516 #[test]
514517 fn test_error_case () {
515518 let result = my_function ("" );
516519 assert! (result . is_err ());
517520 }
518-
521+
519522 #[test]
520523 #[should_panic(expected = " Invalid input" )]
521524 fn test_panic () {
@@ -535,11 +538,11 @@ use tempfile::TempDir;
535538fn test_config_lifecycle () {
536539 let temp = TempDir :: new (). unwrap ();
537540 let config_path = temp . path (). join (" config.toml" );
538-
541+
539542 // Test save
540543 let config = config :: Config :: default ();
541544 config :: save (& config ). unwrap ();
542-
545+
543546 // Test load
544547 let loaded = config :: load (). unwrap ();
545548 assert_eq! (loaded . version, config . version);
@@ -686,6 +689,15 @@ cargo fmt --check
686689rustfmt src/main.rs
687690```
688691
692+ ### Regenerating Shell Completions
693+
694+ Shell completion scripts are generated by ` build.rs ` into the ` completions/ ` directory.
695+
696+ ``` bash
697+ # Regenerate completions (bash/zsh/fish)
698+ cargo build
699+ ```
700+
689701### Building Documentation
690702
691703``` bash
@@ -778,19 +790,22 @@ rust-gdb target/debug/starforge
778790### Common Issues
779791
780792** Issue** : Compilation errors after updating dependencies
793+
781794``` bash
782795# Solution: Clean and rebuild
783796cargo clean
784797cargo build
785798```
786799
787800** Issue** : Tests failing intermittently
801+
788802``` bash
789803# Solution: Run tests serially
790804cargo test -- --test-threads=1
791805```
792806
793807** Issue** : Slow compilation
808+
794809``` bash
795810# Solution: Use sccache
796811cargo install sccache
@@ -948,6 +963,7 @@ fn creates_wallet_with_encrypted_key_when_encrypt_flag_is_true() {
948963```
949964
950965Types:
966+
951967- ` feat ` : New feature
952968- ` fix ` : Bug fix
953969- ` docs ` : Documentation
@@ -957,6 +973,7 @@ Types:
957973- ` chore ` : Maintenance
958974
959975Examples:
976+
960977```
961978feat(wallet): add hardware wallet support
962979
@@ -970,18 +987,21 @@ Closes #123
970987## Resources
971988
972989### Documentation
990+
973991- [ Rust Book] ( https://doc.rust-lang.org/book/ )
974992- [ Rust API Guidelines] ( https://rust-lang.github.io/api-guidelines/ )
975993- [ Stellar Documentation] ( https://developers.stellar.org/ )
976994- [ Soroban Documentation] ( https://soroban.stellar.org/ )
977995
978996### Tools
997+
979998- [ rust-analyzer] ( https://rust-analyzer.github.io/ ) - IDE support
980999- [ clippy] ( https://github.com/rust-lang/rust-clippy ) - Linter
9811000- [ rustfmt] ( https://github.com/rust-lang/rustfmt ) - Formatter
9821001- [ cargo-edit] ( https://github.com/killercup/cargo-edit ) - Dependency management
9831002
9841003### Community
1004+
9851005- [ Stellar Discord] ( https://discord.gg/stellar )
9861006- [ Rust Users Forum] ( https://users.rust-lang.org/ )
9871007- [ GitHub Discussions] ( https://github.com/YOUR_USERNAME/starforge/discussions )
0 commit comments