vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

Fix member operations

Open chrjorgensen opened this issue 2 years ago • 5 comments

Changes

This PR will

  • Enhance the member name validation when creating a member - like the validation when copying a member. This will also allow creating a member without extension.
  • Allow copy of an empty member without showing error. Previously this generated an error even though the member was created.
  • Correctly copy to a member without extension. Previously the new member had the extension from the old member.
  • Add a prompt for confirmation when copying to an existing member.
  • Correctly rename a member to member name without extension. Previously the extension was not removed.
  • Keep the user input on screen until the create, copy or rename member operation has completed. This allows the user to edit the member name to fix the situation.

Checklist

  • [x] have tested my change
  • [ ] updated relevant documentation
  • [x] Remove any/all console.logs I added
  • [x] eslint is not complaining
  • [ ] have added myself to the contributors' list in CONTRIBUTING.md
  • [ ] for feature PRs: PR only includes one feature enhancement.

chrjorgensen avatar Jul 26 '22 21:07 chrjorgensen

@worksofliam I did not change the member name validation code - but I found that it requires a . after the name to accept it as a member without type. And I actually quite like that, since it forces the user to specify the member name in a special format to create it without type.

WDYT?

But I'm not a fan of the way it reports an error in the name specified - IMO it should keep the window and member name when reporting the name error, for the user to edit the name or press Esc to cancel the operation. If you agree, I will code this in the create and copy member functions.

chrjorgensen avatar Jul 28 '22 08:07 chrjorgensen

New commit added - to keep the user input on screen until the create or copy member operation has completed.

chrjorgensen avatar Jul 28 '22 11:07 chrjorgensen

Another commit - keep user input until member is renamed.

chrjorgensen avatar Jul 28 '22 11:07 chrjorgensen

Just found an error - copying a member to itself by only changing the type was not caught (but failed of course). Check added in commit d858386

chrjorgensen avatar Jul 28 '22 15:07 chrjorgensen

@chrjorgensen Hi! Just want to let you know that I will get around to this after tomorrow.

worksofliam avatar Aug 10 '22 18:08 worksofliam

@worksofliam For creating a member without extension, see my comment above.

There were an error when the new name was not in the correct format - this has been fixed. If you still encounter error copying a member with no extension, please specify the steps to reproduce the error. 😉

chrjorgensen avatar Aug 25 '22 21:08 chrjorgensen

@worksofliam Btw, great live PR session today! 👌

chrjorgensen avatar Aug 25 '22 21:08 chrjorgensen

@chrjorgensen Will test this tomorrow as requires a little bit of time to test all the items.

edit: big thanks!

worksofliam avatar Aug 25 '22 22:08 worksofliam