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

no output on run background script in a scope #91

Closed ghost closed 7 months ago

ghost commented 1 year ago

Hello Arnoud,

Thank you for the wonderful SN extensions :)

Was trying to run a background script in a scope and there doesn't seem to be any output although I do see the output appear in the website. Also the keypress CMD + Enter doesn't seem to be picked up to run the script. Where should the output appear in VS Code?

Best regards, Sander

arnoudkooi commented 1 year ago

That is probably an issue after the 3.0 update. Had a question about it on SN Devs Slack as well. I was thinking of removing that feature, as we have the BG Script monitor editor now...

The output does not appear in VS COde but the script should be triggered in the browser btw

ghost commented 1 year ago

Sorry for this support question in the issues. Where can I find more information about the BG Script monitor editor?

arnoudkooi commented 1 year ago

I meant the VS Code style BG script you can enable in the settings (I phrased it bad)

Google Chrome20230915 - 1817

ghost commented 1 year ago

Yeah this helps with making the BG editor in the website nicer. However wanted to see if GitHub Copilot could help me write some ServiceNow scripts and that is only available directly from within VS Code. So think it still is valuable to have the ability to run and see background scripts from within VS Code :)

arnoudkooi commented 1 year ago

Thats a good use case. I'll have a look. will let you know, Goed weekend!

ghost commented 1 year ago

Fantastic :) Jij ook een fijn weekend!

arnoudkooi commented 1 year ago

I leave it open till it is fixed

arnoudkooi commented 10 months ago

Looking into this, it seems to work for me. How about you?

ghost commented 10 months ago

At the moment ⌘↩ only inserts a newline in the current file for me and doesn't execute the script in the browser window. Have to press the right mouse button and navigate towards the menu item "sn-syncscript: Execute backgroundscript (.js files in /background folder only)", which does run the script and presents the output in the browser window.

Another thing I noticed, but maybe its unrelated is that the folder is being created is "no_scope". While the I am sure that the script is being executed in a scope because it allows the ES12 syntax. Maybe this also has to do with our instance that might be a bit different than other ServiceNow instances (we are on the Utah release).