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

Update tab conversion; address issue #996

Open steph-beneschan-256 opened this issue 1 year ago • 5 comments
trafficstars

Changes

  • Updated the escapeString function in extendedContent.ts to convert the UTF-8 tab character \t to 0x05 (the EBCDIC tab character).

How to test this PR

  1. Open VS Code. Connect to any IBM i machine.
  2. In the connection settings under Source Code, turn on Enable Source Dates and set Source Date tracking mode to "Diff mode."
  3. Create a new source member.
  4. Run the "Indent Using Tabs" VS Code command to configure the behavior of the Tab key.
  5. At the beginning of any line, press the Tab key; the UTF-8 tab character \t (not a series of individual spaces) should be prepended to the line.
  6. Save the source member, then close it.
  7. Open Access Client Solutions. Use the 5250 emulator to connect to the same IBM i machine as before.
  8. Run SEU. Open the newly-created source member.
  9. Verify that SEU renders the previously-inserted tab character as a blank space (not as a backslash followed by a lowercase t).
  10. Close SEU. Return to VS Code.
  11. Reopen the new member. Verify that VS Code renders the previously-inserted tab character as it did before.

Checklist

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

steph-beneschan-256 avatar Mar 10 '24 05:03 steph-beneschan-256

I'm coming across a similar issue. I have an existing SQL source member in my QSQLDDLSRC file that was created either in RDI or the green screen, I'm not sure which. It is for creating a stored procedure. I copied it into my project library and opened it with VS Code. I made a minor change to the source code, saved it and exited. When I reopened the source member most of the lines in the member now have the \t in front of them. So far this has only happened to me with an SQL member, none of my RPGLE source code has had this happen yet.

I tried turning off the 'Enable Source Dates' and no longer had this happen, but we use source dates, so I don't want them to be wiped out if I open an existing source member in VS Code to make a modification.

casweet72 avatar Mar 11 '24 20:03 casweet72

@casweet72 This PR should solve that issue!

worksofliam avatar Mar 14 '24 19:03 worksofliam

@steph-beneschan-256 Thanks for your PR, once again!

I would like to write a test case for this PR. Do you mind if I add some commits to add a test case for it?

worksofliam avatar Mar 14 '24 19:03 worksofliam

@worksofliam So sorry I missed your message! Sounds good, please add the commits.

steph-beneschan-256 avatar Mar 16 '24 22:03 steph-beneschan-256

So sorry, I'll look at the issue tonight if that's okay

steph-beneschan-256 avatar Mar 22 '24 13:03 steph-beneschan-256