Advertisement

Author Topic: Squint - the sqf editor and error-checker  (Read 3916 times)

0 Members and 1 Guest are viewing this topic.

Offline sbsmac

  • Members
  • *
  • I'm a llama!
Squint - the sqf editor and error-checker
« on: 23 Aug 2010, 10:52:01 »
Squint is an editor and static-analyser for ArmA script files and can save you many hours of headache by detecting syntax errors and common logic problems before you even run your scripts in a mission.

Whilst it was primarily designed for sqf analysis, it can unbinarise rap files, even those within pbos, and do cursory analysis on these.  This is an area I'm particularly keen to improve and not being an addon-maker myself I could do with some advice on what 'common errors' could be caught.

You can learn more about it from this presentation: https://docs.google.com/present/edit?id=0AZ7iqGyosaZyZGNkOHg2Z3ZfMjVjM3JwN3FjNw&hl=en

there is also a basic guide to getting started: https://docs.google.com/present/edit?id=0AZ7iqGyosaZyZGNkOHg2Z3ZfNWQ2aHNuM2hk&hl=en

Installation instructions are at https://sites.google.com/site/macsarmatools/squint/installation-1

There are certain to be a few bugs as well, please help me out by reporting them rather than ignoring them. I'm also particularly keen to get your suggestions on the kinds of errors you find in your code which squint does not yet catch.

Here's a screenshot...

« Last Edit: 23 Aug 2010, 12:40:37 by sbsmac »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Squint - the sqf editor and error-checker
« Reply #1 on: 23 Aug 2010, 12:32:19 »
Very much recommended to every scripter.  :good:
No matter if you are beginner or expert.
It will be extremely helpful to any level of expertise.

Even more you can make the app even more useful
and powerful by providing Mac with feedback and suggestions.  :clap:
« Last Edit: 23 Aug 2010, 12:34:15 by kju »

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Squint - the sqf editor and error-checker
« Reply #2 on: 23 Aug 2010, 12:58:11 »
As I said on the BIS forums: a thoroughly brilliant tool, and one I'll be making extensive and exclusive use of in the future.  Something I've wanted to do for a long time, but never had the patience to follow through on it (language parsing has always frustrated me  :P).

As kju said, I'd thoroughly recommend this to all and sundry.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Squint - the sqf editor and error-checker
« Reply #3 on: 28 Aug 2010, 16:09:19 »
How can i download the installation file so that I could later install SQUINT on my laptop which has no Internet Connection?

Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline sbsmac

  • Members
  • *
  • I'm a llama!
Re: Squint - the sqf editor and error-checker
« Reply #4 on: 28 Aug 2010, 19:20:32 »
Hmm - tricky one.  Squint doesn't need an internet connection to run but it does need one for installation (and auto-update).

It's possible you could work around the installation problem by installing it on a connected PC then copying the exe and related dlls to your laptop. You can find them by searching under
"Documents And Settings\<username>\Local Settings\Apps\..."
« Last Edit: 28 Aug 2010, 19:22:13 by sbsmac »

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Squint - the sqf editor and error-checker
« Reply #5 on: 29 Aug 2010, 16:35:11 »
I'll try it, thanks for the reply and for this tool which seems very useful.

Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline sbsmac

  • Members
  • *
  • I'm a llama!
Re: Squint - the sqf editor and error-checker
« Reply #6 on: 29 Aug 2010, 20:43:18 »
No problem.  :)

Probably worth posting the latest update here as well (copied from the project update page

----------------------------------------------------------------------------------------

Squint went public just over a week ago and the feedback has been extremely pleasing...
  • "Flippin awesome tool. fixed a bunch of errors right on loading."
  • "Awesome tool thanks for sharing, already found some errors in a couple of scripts that I didnt even notice."
  • "Squint is a major help in finding errors - it found quite a few I must say I was shocked it was able to find (nice tracing through files)"
  • "This is amazing stuff! The best scripthelper created over the last 10 years. Love it!"
  • "Sorry SQF plugin for N++. It's just that I've met someone else. Someone who really get's me."

But no release is perfect and there have been a lot of great suggestions on how to improve squint.  Based on those I've been working hard to add the following features....

    * Support for the following file-extenstions: *.ext;*.sqm;*.cpp;*.hpp;*.rvmat;*.bin;*.cfg;*.pbl
    * Line-numbers have been added to the code-window.
    * Search and replace have been added
    * An 'undo' feature has been implemented
    * A basic auto-indent has been implemented; you can auto-indent code as you go along or select a region and hit TAB to auto-indent.
    * Auto-complete/intellisense has been implemented.  When enabled, squint will monitor your typing and offer you a choice of possible completions in a pop-up dialog box. This really saves a lot of time and effort for those long BIS_fnc_.. names! Auto-complete can also offer you completion for local variable names that are in scope and can help you avoid 'bracket-fatigue' by offering completions for common control constructs, eg  "for [{},{},{}] do {};" as a completion of "for".
    * The colour scheme is more flexible than before. You can change the background colour and font used by the file-list and error-list and you get an immediate preview of your colour-changes for the code-window.
    * You can import and export colour 'themes'; I hope to host some user-made themes on the squint website over the next week - please contact me via the BIS forums if you have a colour-scheme you'd like to share.
    * BIS & ACE function names have been added to the dictionary as 'known' global variables.
    * An external helper app allows shell-integration.  Just right click on a file to open it in squint !
    * Support for binarised files is now implemented.  You can edit the contents of config.bin or any other binarised file, even those already inside pbo's.
    * The error-detection phase is now much faster for large multi-file projects.
    * The code-window now has much less flicker when jumping around within a file.
    * As well as the new features, a significant number of bugs have been fixed including one that could cause squint to hang while idle.


Thanks to all who have provided feedback so far - please keep it coming to help me improve the tool.

To learn more about the new features, see these two links

    * Shell integration
    * Tips & Tricks


As always, existing users should find that they are automatically updated to the latest version which is currently 1.0.0.95.  If squint is not updating, you can force an update by re-running the setup file.

-------------------------------------------------------------------------------------------------

I'm current working on support for 'big' projects (ie 10s to 100s of files) where there is a requirement to be able to mask certain squint errors (on a per-file or per-block basis). As always, feedback from actual users is appreciated - I'm always particularly keen to hear about the script-errors that squint doesn't find.

Offline sbsmac

  • Members
  • *
  • I'm a llama!
Re: Squint - the sqf editor and error-checker
« Reply #7 on: 03 Sep 2010, 23:52:55 »
This week's update...

Squint is starting to take shape as the kind of tool I want it to be.  Some recent changes have made it much more useful for analysing large projects.
 
Firstly, there is a powerful new filter system which you can read about at https://sites.google.com/site/macsarmatools/squint/filters-and-the-dictionary. This enables you to quickly filter out 'false' warnings or those which you're not interested in.

Second, squint now does a much better job of only recalculating invalid data, for example when you update the filter list squint now only recalculates the error list rather than reparsing every file.  Processing of large files is also now much faster.

Thirdly the UI responsiveness has been much improved, particularly when auto-complete is enabled.


My testbed for these changes has been the Operation Arrowhead missions.pbo file which contains over a thousand sqf, cpp and hpp files. On my 2GHz laptop squint is now able to read, analyse and report on this pbo in less than 30 seconds.  Constructing a set of filters to focus in on the important bugs takes around 10 minutes.

In addition to these changes, I've added several new error-checking rules and fixed the usual clutch of bugs.  As always, I'm keen to hear from people on how they think the tool can be improved, my next focus will probably  be on config files where there are still some improvements required in squint's ability to recognise some kinds of input.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Squint - the sqf editor and error-checker
« Reply #8 on: 13 Sep 2010, 15:47:39 »
I really really want to use this tool as it sounds cool.

But with that internet requirements for the setup, I can't use it.

Hope you would add a REAL setup file soon.

Also, thanks for developing such a helpful tool for the community.


Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline sbsmac

  • Members
  • *
  • I'm a llama!
Re: Squint - the sqf editor and error-checker
« Reply #9 on: 16 Sep 2010, 17:02:44 »
Hmm - does the suggestion to install on a connected machine then just copy the exe across not work for you ?

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Squint - the sqf editor and error-checker
« Reply #10 on: 17 Sep 2010, 09:30:55 »
They use Deep Freeze here, so when you restart, nothing's left...
(restart is required when dot-net 4.0 is finished installing the contents)

And what's the point of requiring an internet connnection to install your software?

That software, visual dialog maker also required an internet connection, is that yours too?(just a doubt)



Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline sbsmac

  • Members
  • *
  • I'm a llama!
Re: Squint - the sqf editor and error-checker
« Reply #11 on: 18 Sep 2010, 22:27:10 »
Quote
They use Deep Freeze here, so when you restart, nothing's left...
(restart is required when dot-net 4.0 is finished installing the contents)

Interesting - I wasn't aware of this application- your original request makes a bit more sense now I understand you only have network access at work ! :)

Quote
That software, visual dialog maker also required an internet connection, is that yours too?(just a doubt)

No - that was from someone-else.

Quote
And what's the point of requiring an internet connnection to install your software?

Squint uses 'Clickonce' deployment (see http://en.wikipedia.org/wiki/ClickOnce).  The huge advantage of this from my perspective is that it provides automatic updating for users.  Since I am still adding several features each week this makes it much easier to keep everybody in step with the latest version.

I've been looking at whether it is possible to get ClickOnce to install from a local copy but haven't found anything yet... sorry.

*Edit* you could try copying the contents of http://www.armaleague.com/mac/squint/bin/ to a local directory and running the setup.exe from there.   I really don't know if this will work though.
« Last Edit: 18 Sep 2010, 22:34:15 by sbsmac »

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Squint - the sqf editor and error-checker
« Reply #12 on: 25 Sep 2010, 15:53:33 »
Thanks for considering my advise...
Quote

you could try copying the contents of http://www.armaleague.com/mac/squint/bin/ to a local directory and running the setup.exe from there.   I really don't know if this will work though.

I've already tried that and it failed.

Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline zonker3210

  • Members
  • *
Re: Squint - the sqf editor and error-checker
« Reply #13 on: 29 Sep 2010, 17:47:51 »
Squint uses 'Clickonce' deployment (see http://en.wikipedia.org/wiki/ClickOnce).  The huge advantage of this from my perspective is that it provides automatic updating for users.  Since I am still adding several features each week this makes it much easier to keep everybody in step with the latest version.

I've been looking at whether it is possible to get ClickOnce to install from a local copy but haven't found anything yet... sorry.

Have you tried setting the "Install Mode" setting?

How to: Specify the ClickOnce Offline or Online Install Mode
http://msdn.microsoft.com/en-us/library/y0507x17%28VS.100%29.aspx

An alternative is to create two separate build configurations as detailed here...
http://stackoverflow.com/questions/1679889/clickonce-cd-setup-tries-to-connect-to-the-internet

It's really not that hard to do from your perspective but users such as haroon1992 will need to understand that they won't reap the benefits of the ClickOnce update system. I doubt that's a major problem when compared to not being able to use Squint at all without an offline installer.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Squint - the sqf editor and error-checker
« Reply #14 on: 29 Sep 2010, 18:02:36 »
Right now,I just want to use the software.

(I wish updates to be also downloadable ones just like ArmA Edit)

Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(