arnoudkooi / sn-scriptsync

Use sn-scriptsync in combination with SN Utils to be able to code in VS Code, including all benefits of a full fledged code editor
https://marketplace.visualstudio.com/items?itemName=arnoudkooicom.sn-scriptsync
Other
43 stars 28 forks source link

Regex not populated correctly for background script #53

Closed gczutor closed 3 years ago

gczutor commented 3 years ago

Using this line in my code in VSCode: short_description == short_description.match(/^\[.+\s\|\s.+\]\s.+/);

And what's populated in the background script editor in SN is: short_description == short_description.match(/^[.+s|s.+]s.+/); (note the missing backslashes in the regex)

Steps to reproduce:

arnoudkooi commented 3 years ago

I was wondering if anyone uses this :) I can replicate, this needs to be addressed in SN Utils. I'll have a look

gczutor commented 3 years ago

Now you know there's at least one; me. :)

Actually, I've found that escaping the backslash (like \) works but then the resulting code is not just a copy-paste away from any other script field (like Script Include) so it's not very comfortable. You may want to have a look escaping it 'yourself' when sending it from VSCode to the browser, I think that's the place to catch it.

arnoudkooi commented 3 years ago

I did do an update here, could you update to 1.9.9 and try? Just curious are you also using it for other purposes?

arnoudkooi commented 3 years ago

I do need to make an update to SN Utils as well, please stand by :)

arnoudkooi commented 3 years ago

Please update SN Utils to 5.0.2 and try

arnoudkooi commented 3 years ago

were you able to try?

gczutor commented 3 years ago

Sorry mate not yet. Going to get back to you as soon as I can.

gczutor commented 3 years ago

Seems working fine with 1.9.9

Well for what purpose I use sn-scriptsync? I usually 'mirror' code of SIs and other records into it and develop my code. Works great (now also with regular expressions) and the comparison window is great if anything happens. I used to use S.N.I.C.H but started not liking its folder structure and that I have to add sys_id for each table config to get the script files named accordingly in order to differentiate between same named records. You have this as default in sn-scriptsync so it's better for me.

arnoudkooi commented 3 years ago

Great, thanks for feedback and confirming it works!