Skip to content

improve superadd#157

Merged
sigmaSd merged 1 commit into
sigmaSd:masterfrom
actuday6418:master
Aug 19, 2025
Merged

improve superadd#157
sigmaSd merged 1 commit into
sigmaSd:masterfrom
actuday6418:master

Conversation

@actuday6418

Copy link
Copy Markdown
Contributor
  • We now find the actual workspace/crate root instead of copying the given path directly. We still add only the given crate and not the whole workspace.
  • There's an issue with adding crates that have local path dependencies that I wanted to solve. I looked into a number of possibilities but I think the only way is to parse Cargo.toml and "vendor" those dependencies. I avoided that here because of the complexity and because it is likely to be brittle.
  • We use the path hash to create the temporary folder and the temporary folders are deleted only at shutdown. This is to prevent unnecessary copying every time we reload the same dependency.

@sigmaSd

sigmaSd commented Aug 19, 2025

Copy link
Copy Markdown
Owner

For :sadd you can just change this https://github.com/sigmaSd/IRust/pull/157/files#diff-5bf54fed045d43c97cfa116fc81826ab7233767b77059365e6b6b1940d99a8d1L227 to if input.starts_with(":sadd")

@sigmaSd

sigmaSd commented Aug 19, 2025

Copy link
Copy Markdown
Owner

For 2. : Maybe you can:

  • parse the Cargo.toml
  • note any local paths
  • transform them to absolute paths
  • copy the crate
  • change the local paths to absolute

@actuday6418

Copy link
Copy Markdown
Contributor Author

For :sadd you can just change this https://github.com/sigmaSd/IRust/pull/157/files#diff-5bf54fed045d43c97cfa116fc81826ab7233767b77059365e6b6b1940d99a8d1L227 to if input.starts_with(":sadd")

How can we tell irust that though? It wouldn't be in :help right?

@sigmaSd

sigmaSd commented Aug 19, 2025

Copy link
Copy Markdown
Owner

There is no api for that yet, but I think its possible to add a new command like CommandDoc or something that appends to the help text and show up in tab completion, but for now I think you can just do the change, either way the current script doesn't document its behavior as well

@sigmaSd sigmaSd merged commit 6e6f68b into sigmaSd:master Aug 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants