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

Open path from URI

Open worksofliam opened this issue 1 year ago • 5 comments
trafficstars

Changes

  • [x] Add new url for opening files at a specific path
  • [x] Add improved error handling in the new URI
  • [x] When the host is provided, but the user is not connected, then automatically connect if the connection is defined
    • [x] Depends on #1975
  • [x] Nice to have: make sure Sandbox mode still works

How to test this PR

  • vscode://halcyontechltd.code-for-ibmi/open?path=/home/liama/xyz
  • vscode://halcyontechltd.code-for-ibmi/open?host=1.1.1.1&path=/home/liama/xyz

Examples:

  1. Run the test cases
  2. Expand view A and right click on the node
  3. Run 'Execute Thing' from the command palette

Checklist

  • [ ] have tested my change
  • [ ] have created one or more test cases
  • [ ] updated relevant documentation
  • [ ] Remove any/all console.logs I added
  • [ ] have added myself to the contributors' list in CONTRIBUTING.md

worksofliam avatar May 07 '24 14:05 worksofliam

👋 A new build is available for this PR based on 7a6a00bd4ae268a49c80030bd1f2c5252ac0714b.

github-actions[bot] avatar Jun 03 '24 07:06 github-actions[bot]

If they have no current connection would it beneficial to allow the user to pick one? Instead of a warning message.

Also I am unsure the purpose of the host param as the below two scenarios arent covered:

  • Scenario 1: if you arent connected it doesnt auto connect to the given host, isntead it just gives a warning it cannot open the file. I think it should ask to auto connect if the given host is on the list. If the host is listed more than once then give me the option to pick which connection to initiate
  • Scenario 2: if you are connected to the wrong host, it just prompts to open with the current connection. We should also have the option to switch to the correct connection, again if there is more that one listed conneciton to the same host then allow me to pick which connection to initiate

julesyan avatar Jun 07 '24 16:06 julesyan

@julesyan Thanks for your great testing.

  1. Yes, we should automatically connect to the host given it is in the list.
  2. Right now we don't even have the internal logic to disconnect and reconnect to a new system automatically. Let me see if this is even possible (since we do have APIs to do both separately.)

worksofliam avatar Jun 17 '24 17:06 worksofliam

@julesyan This works now:

vscode://halcyontechltd.code-for-ibmi/open?host=oss74dev&path=/home/LIAMA/hebrew.txt

worksofliam avatar Sep 11 '24 13:09 worksofliam

Tested locally and found no more issues, looks good!

julesyan avatar Sep 11 '24 15:09 julesyan