VSCode Extension

sentry07sentry07 Junior MemberPosts: 68

Anyone interested in working on an extension for Netlinx in VSCode? I've got Syntax Highlighting working pretty well and have Help and Compile shortcuts set up so far. Am just learning how to make this stuff for VSCode so I'm still trying to learn how to do the more advanced stuff. Would really like to move away from using NS4 for development and just use it for managing transfers and such.

Here's what I have so far.
https://github.com/sentry07/vscode-amx-netlinx

To install it, clone or download/unzip the folder containing files into C:\Users\.vscode\extensions

Comments

  • HARMAN_icraigieHARMAN_icraigie Technical Trainer II, Harman Professional University Posts: 492
  • sentry07sentry07 Junior Member Posts: 68

    Yeah I've been looking at his stuff and some others. I never really used Sublime since Netlinx Studio is pretty decent and I've built up a toolbox over the years for code snippets and such. I'm just really getting into VSCode and think it's going to be our main development environment for the near future. There's a Netlinx grammar for Atom editor as well, which is where I pulled the bulk of the syntax highlighting from for this extension. I've been redoing the regex for some things to make the highlighting better. Also added shortcuts for FT2 and Netlinx Diagnostics. Interesting that FT2's landing page is no longer available, but the user agreement page and files are still on the website. Had to hit the WaybackMachine to download it on this machine last night.

    Eventually, I'd like to get a language server written for Netlinx. May be a while though.

  • sentry07sentry07 Junior Member Posts: 68

    Made quite a few updates since posting this. Recent updates include:

    • Code beautifier (necessary because Netlinx Studio handles indents really weird)
    • User settings for Compiler: global include, library and module directories
    • Shortcuts for opening the global directories in your workspace

    Will hopefully publish to the extension library in the next few days so you can install via the Extension Browser and update automatically.

  • sentry07sentry07 Junior Member Posts: 68
    edited March 11

    Extension is available in the Marketplace. I've put a ton (60+) of code snippets for Netlinx blocks. Everything from IF statements, FOR loops, up to DATA_EVENTs and even more. Don't really have an up to date list at the moment but you can count on almost everything that's useful being in there.

  • richardhermanrichardherman not-so-junior member Posts: 228

    @sentry07 said:
    Also added shortcuts for FT2 and Netlinx Diagnostics. Interesting that FT2's landing page is no longer available, but the user agreement page and files are still on the website. Had to hit the WaybackMachine to download it on this machine last night.

    It's been a long while since I've had either installed, so I could be mistaken, but if I remember correctly, you can't add a username / password for your connection to the controller to either FT2 or Netlinx Diagnostics, making them pretty useless, at least for me.

  • sentry07sentry07 Junior Member Posts: 68
    edited March 11

    Both of them work for me with user/pass. I even loaded a NS4 workspace into FT2 (having not been updated since 2008) and it still worked perfectly fine.

    There are still a lot of other things that NS4 can do that I haven't even considered in VSCode, so we can't drop it completely yet. I may figure out how to generate APW files, but until then, we still have to build the workspaces in NS4 for FT2 to use.

  • sentry07sentry07 Junior Member Posts: 68

    If I can get AMX developers onboard with helping build the extension, we could get some real shit done. ;)

    You guys know Javascript really well, don't you? :)

  • sentry07sentry07 Junior Member Posts: 68

    Looks like quite a few people have installed the extension. Any feedback so far? I never tried Sublime so I don't know how it worked, but VSCode has been a game changer for me. Only been using NS4 for debugging.

    Some extensions I'm using:
    Open In Application - This allows you to right click files like TP4 files in the workspace and open them in TPD like you would in a Netlinx workspace
    One Dark Pro theme - Beautiful theme that actually has colors set for all the grammar items we're using in syntax highlighting
    Settings Sync - Just for syncing your settings between machines

  • AvargasAvargas Junior Member Posts: 56

    @sentry07 said:
    Looks like quite a few people have installed the extension. Any feedback so far? I never tried Sublime so I don't know how it worked, but VSCode has been a game changer for me. Only been using NS4 for debugging.

    Some extensions I'm using:
    Open In Application - This allows you to right click files like TP4 files in the workspace and open them in TPD like you would in a Netlinx workspace
    One Dark Pro theme - Beautiful theme that actually has colors set for all the grammar items we're using in syntax highlighting
    Settings Sync - Just for syncing your settings between machines

    I've been trying it and it's amazing, great job sir.

    If there is anything I could do to help, let me know. I'm interested.

  • sentry07sentry07 Junior Member Posts: 68
    edited May 6

    I think the two major milestones I have planned for the extension are the language server, which I'm still trying to figure out how to do, and being able to do file transfers from VSCode. The FT2 utility has a command line executable that you can use to transfer files, but I'm still working out whether to piggyback off the existing APW workspace file format or define some kind of file that will just be in the project folder, like a project.json that lists out the systems and their connection properties and master files, etc.

    At the moment, unless our AMX work picks back up, it may just be in its final form unless others want to pitch in and further develop it. At this point I've sunk probably 20-30 hours just in learning the VSCode framework and testing and debugging and refactoring the javascript/typescript code.

Sign In or Register to comment.