Jump to content
  • 0

Notepad++ Script Checker


Liqu1dShadow

Question

I don't know where to put this so ill start here as it has something to do with scripting.

 

Does anyone have or can build a NotePad++ checker where you can import two docs and it will tell you where the differences are with coloured text?

 

So when they release new Battleye scripts for example we can import ours, the new one and it will show the differences or if someone has an issue they can import theirs and a working one to see the differences.

 

speed up the process of server updates and problem finding soooo much faster

 

Just a thought

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

You can also use KDiff3 (free software) for 3-way file comparison if you need (nothing to do with SQF syntax though).

screenshot_merge.png

 

After testing several side-by-side file comparison utilities nowadays on Windows I mostly use WinMerge (screenshot below) for 2-way comparison.

It also is free software, really quick and it feels the best & lightest on system resources.

 

I only use KDiff (screenshot above) when I need a threesome.

filecmp.png

 

 

I do not know any script syntax parsers - if anyone knows one please do share?

I am starting to think this (restarting the server due to a missing ; or } is the one single massive timewaster in SQF scripting in my limited experience).

 

EDIT: I am talking about a parser, an external utility that can (on-demand) go through code block by block, and confirm that all paranthesis/brackets are closed also that no typos like (whiel) etc. exist.

Obviously this will help a lot by preventing the 2-3 minute startup time with a broken SQF file.

Link to comment
Share on other sites

  • 0

Just to keep the thread updated, axeman kindly a utility which is super cool

squint - Arma scripting tool. It does a lot of Arma specific things which you can't find anywhere else...

 

Now, the down side is, it is indeed outdated. It "thinks" some of the Arma3 commands/syntax is bad and recommends a fix.

Some of the recommendations actually break the working command [ such as adding ; to a command which actually expect a parameter ].

 

In the end I am still using squint to quickly inspect the changed documents before I startup the server:

it is helpful in detecting a missing ;

it is harmful in proposing a breaking-'fix' to a working line. I guess you need to be aware of its quirks and do some post-processing of squint's output.

 

I hope in time I will get better in discarding its garbage and just benefit from its syntax checker.

Link to comment
Share on other sites

  • 0

Im thinking of making a plugin for phpstorm for sqf, but might be quite the work haha ^^

phpstorm is commercial isn't it - is there no free software to base such a project :(

 

I looked at gnu gpl "syntax checker" options but couldn't find anything...

Link to comment
Share on other sites

  • 0

Well, they have a free edition ( Web Storm). With less possibilities, but still, i just love an IDE more for programming, since i don't need to open seperate files and integrated git and stuff.

I'm currently looking into another program first to since someone brought it up to my attention

Link to comment
Share on other sites

  • 0

I have found the easiest way is to record all your changes into a seperate file and just merge them. 

Feel free to browse my updates for my A3 server - located here https://github.com/KingRaymond/A3Epoch

I place them on the line they're meant to be on, makes it easier to merge :) - I am new to BE editing - so those gurus out there.. take it easy :)

Link to comment
Share on other sites

  • 0

Here's a netbeans sqf solution: http://www.armaholic.com/page.php?id=14714

 

and my personal favorite eclipse plugin for sqf:  http://forums.bistudio.com/showthread.php?124120-ArmADev-Eclipse-Plugin

 

honestly squint is pretty rough around the edges.  It throws a lot of false positives from what I've seen.  Also pretty damn ugly to work with imo.

 

both of the solutions I've posted integrate with SVN and Git right out of the box and to me that is a huge advantage.  If you aren't using version control when you are coding, you are doing it wrong!

Link to comment
Share on other sites

  • 0

Here's a netbeans sqf solution: http://www.armaholic.com/page.php?id=14714

 

and my personal favorite eclipse plugin for sqf:  http://forums.bistudio.com/showthread.php?124120-ArmADev-Eclipse-Plugin

 

honestly squint is pretty rough around the edges.  It throws a lot of false positives from what I've seen.  Also pretty damn ugly to work with imo.

 

both of the solutions I've posted integrate with SVN and Git right out of the box and to me that is a huge advantage.  If you aren't using version control when you are coding, you are doing it wrong!

I just reached 250+ commits this week in my first script project. As I keep working with more SQF files and as they get bigger in size I came to realize my initial opinion & love at first sight for squint is short lived.

Its editor definitely sucks due to its inability to understand Arma 3 structures and it's visual inconsistency with Notepad++ [e.g. whitespace size].

 

It is still the best (in fact only) tool I can find to detect an open } so I still use it time to time to check script files, especially when I migrate a long script from another (a week old) branch to working tree. Copy & paste errors happen often...

I still use Notepad++ as the main editor BTW but I will check out the other editors you mentioned in this thread.

 

Having finished functional version 0.1 of my script I found the main piece at about 3000 lines long.

I read on the BIKI that normally SQF scripts should be about 200-300 lines long so I'm already in the process of rewriting the whole script based on functions this time. Much shorter and more efficient (hopefully!)

This is the most effort an SQF script ever got I think, zero active users and already a whole rewrite :D

 

This being the case, I am trying really hard to refrain myself from putting this project on hold and writing a SQF code validator in python or bash or whatever...

Link to comment
Share on other sites

  • 0

I just reached 250+ commits this week in my first script project. As I keep working with more SQF files and as they get bigger in size I came to realize my initial opinion & love at first sight for squint is short lived.

Its editor definitely sucks due to its inability to understand Arma 3 structures and it's visual inconsistency with Notepad++ [e.g. whitespace size].

 

It is still the best (in fact only) tool I can find to detect an open } so I still use it time to time to check script files, especially when I migrate a long script from another (a week old) branch to working tree. Copy & paste errors happen often...

I still use Notepad++ as the main editor BTW but I will check out the other editors you mentioned in this thread.

 

Having finished functional version 0.1 of my script I found the main piece at about 3000 lines long.

I read on the BIKI that normally SQF scripts should be about 200-300 lines long so I'm already in the process of rewriting the whole script based on functions this time. Much shorter and more efficient (hopefully!)

This is the most effort an SQF script ever got I think, zero active users and already a whole rewrite :D

 

This being the case, I am trying really hard to refrain myself from putting this project on hold and writing a SQF code validator in python or bash or whatever...

 

dude, as I was reading this, I was thinking the same thing about the validator.

 

 

this is the armaeditor (eclipse) I posted about.  Check the screenshot, its similar to notepad++ that it can detect brackets and such and that has saved me a ton of headaches!

 

yScKhld.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...