Forum Discussion

David_Bond's avatar
David_Bond
Icon for Professor rankProfessor
2 years ago

LogicModule development: script editor line numbers

Great news!  LogicMonitor is finally adding line numbers to the groovyscript editor.

Only joking.  It’s STILL rubbish and there are no plans to fix it.

When pairing LogicModule development I STILL have to say “up about 6 lines”, “no not that line” and “down a bit” every few seconds.

  • I agree that the extension should be “built in”. I prefer using that to running scripts via the DataSource global def page.

    That said, I do believe that is the idea with the new “Modules” section.

    Right now, line numbers are present when viewing modules both in the toolbox and Exchange (with fullscreen):

    There’s also line numbers in the new module creation page:

    So yeah, things are def moving in that direction! 

  • Hi Guys,

    ** POSTED ON Another Thread but seems related so COPY and Pasted it, any feedback would be appreciated **

    I have written a VSCode extension here:

    https://github.com/David-Brierley/Logicmonitor---VSCode-Groovy-extention/tree/main

    Its for running groovy scripts against devices from within the VSCode IDE.

    In short.
    You login using your company and APIKey (LM Bearer Token).
    ^^ These are stored in secretStorage on VSCode and can be set to clear each time you use the extension.

    You then right click in the window and run the script (Or run from command pallete)

    It will open a couple of prompts that will let you search for the device by either name or IP address.
    You then select the device and the script runs and it returns the output in a web view panel.
    Theres some other commands etc.

    I haven't published it to the exchange yet as its the initial release of it and theres still bits to do but all the source code is in the above repo and the VSIX file is too so you can download it and install it through there.

    If anyone wants to check it out then feel free to, Its my first time writing a VSCode extension, I use JS / Node for react but mainly I develop in Python so there may be a few Python Mannerisms in the code.

    Anyways hopefully it can help somebody, feel free to contribute or request other features or changes and I'll get round to sorting.

    Cheers !