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

show editing package version like editing 1.2.3 #379

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aelam
Copy link
Contributor

@aelam aelam commented Jul 30, 2022

show editing version like editing 1.2.3

blocker #378

Screen Shot 2022-07-30 at 14 26 04

@swift-server-bot
Copy link

Can one of the admins verify this patch?

3 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@@ -292,7 +292,13 @@ export class PackageDependenciesProvider implements vscode.TreeDataProvider<Tree
private dependencyDisplayVersion(dependency: WorkspaceStateDependency): string {
const type = this.dependencyType(dependency);
if (type === "editing") {
return "editing"; // ?TODO: get version from `baseOn` node for showing `editing 1.2.3`
if (dependency.basedOn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user is editing a package using a local version of the dependency ie they ran

swift package edit <dependency> -path <local-version-folder>

I don't think we can say it is based on a particular version. We can only say it is editing <version> when they have called

swift package edit <dependency>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editing is ok to me no strong opinion about it

but I'm trying to understand the real use case of edit

When is the right scenario that we should use edit?

  • it has been a dependency already
  • it can't be a local dependency before you edit

So im thinking the scenario is that

  • If it's local dependency you can change whatever freely which is nothing about edit
  • if you edit remote dependency, it means the engineer wants to make some change on current remote version/branch, then they get a chance to fix the existing issues of current version (or switching other version? to check)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two versions of swift package edit are for different situations

  1. without a path is generally used for testing a quick change to a dependency. I just need an editable copy of the current version of that dependency. Including the version in the editing string makes sense here as your changes are based of a specific version of the dependency.
  2. With a path argument is used when I have been developing a feature in one of the dependencies independently of the current package and I want to test that new feature in the current package. I can then say I would rather use this version of my dependency over the version downloaded from the repository. In this case because there is no versioning link between the two versions of the dependency it doesn't make sense to include the version number in the editing string

Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. fully understand these cases.
if we really want to show the editing version in the case 2, probably we should also show the real version of the dependency in case 1

Do we continue this PR to see the result. here I summarize a bit.

  1. show editing 1.2.3 for case 1, show editing for case 2
  2. show editing 1.2.3 for case 1 and case 2. needs to read info swift package describe
  3. leave them as editing. close this

Which one do you prefer.
If it's 3, I'd like to create another PR about showing menu of use locally by right click, so that swift package edit can be done in UI action

@adam-fowler
Copy link
Contributor

@swift-server-bot test this please

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.

3 participants