Jump to content
Sign in to follow this  
sbsmac

Looking for alpha testers for script-editor/error-detection tool

Recommended Posts

Please only download if you are prepared to work with an alpha-level tool which is undergoing rapid changes and are willing to offer bug-reports and constructive feedback.

Squint is an editor/static-analyser for sqf. That means it can detect syntax errors and common coding errors in your scripts as you are editing them.

Typical detected errors are...

* All syntax errors (missing semi-colons, brackets etc)

* Unused local variables.

* Local variables not declared private.

* Incorrect types of argumenents passed to BIS functions.

See http://dev-heaven.net/projects/squint/wiki for download details

Share this post


Link to post
Share on other sites

Still looking for a few more testers - 36 downloads but not a lot of feedback... :-)

Edited by sbsmac

Share this post


Link to post
Share on other sites
Still looking for a few more testers - 36 downloads but not a lot of feedback... :-)

I'm sorry, still waiting for a reboot here, so the .net4 installation may finish.

hahaha :D

Share this post


Link to post
Share on other sites

Thanks Gents- good to see people giving it a go :-)

>If I were you I'd take silence as an 'it's working' from any testers

Well, you are allowed to request improvements - I don't claim it's perfect yet ! I'm particularly interested hearing about errors it doesn't catch which you think it should...

Share this post


Link to post
Share on other sites

So I finally managed to reboot my system. Ha. My first impression isn't bad and what comes to mind is this:

  • Don't install software without beeing asked where it should go. Ever.
  • Do not mess with my start menu or create shortcuts anywhere else - without asking me first.

These things are plain rude and are the reason that everybody hates these "installers" (okok, trying to install 3rd party software and annoying toolbars has probably a bigger impact, hehe).

Good were the times one could simply unzip the software, ready, go. :D

As to squint itself:

  • The toolbar is buggy as hell. I think it would be much better, if you could lock it to exactly one lane.
  • It's nice current errors can be copied to the clipboard, but why is this somewhere hidden in the menu? I tried to copy the error where it's displayed - naturally. But this didn't work. So the Errors should be selectable text. And if a complete error is selected, it would be nice, if the type/severity would be appended (well, as prefix, so the other way around, hehe). The toolbar button is unecessary too, for really, the text should be selectable.
  • Why is the fontsize of the editor so huge? Ok, fontsizes are always tricky, so it would be nice if we could set our own.
  • It would be nice to have linenumbers in the editor.
  • Get rid of the "Not all files are saved - really exit?" popup. Or make it an option.

But otherwise it looks fine.

As to bug reporting: do you accept it if we submit already created scripts/functions (in full) as examples (together with a short note) or do you insist on small artifical demos?

Oh and while we're at it: what does No matching signature for... mean? For example:

No matching signature for '<Unused> modeltoworld <Any>'
No matching signature for '<Unused> direction <Unused>'

Are these commands just not in the command-library/vocabulary yet?

And another one I don't understand:

Fix: Change/Insert 'private' array here?

which conserns typical private statements. And how to interpret "fix" anyway? Whats that for a "severity"?

Edited by ruebe

Share this post


Link to post
Share on other sites

Thanks for the feedback. A few responses...

* Don't install software without beeing asked where it should go. Ever.

* Do not mess with my start menu or create shortcuts anywhere else - without asking me first.

I appreciate some people feel strongly about this but it's really much easier for me to distribute (and keep up to date ) using Microsoft 'ClickOnce' deployment. This installs stuff to your %appdata% directory. You can easily remove it using add/remove programs. There are no shortcuts created but there is a link created under 'Macs Tools' in the start menu.

The toolbar is buggy as hell. I think it would be much better, if you could lock it to exactly one lane.

Could you explain what you mean ? I haven't noticed any problems with it (but then I may well be missing the problems because I know what buttons to avoid!). You should be able to drag the toolbars to any edge of the screen and they should then stay there even across reboots.

It's nice current errors can be copied to the clipboard, but why is this somewhere hidden in the menu? I tried to copy the error where it's displayed - naturally. But this didn't work. So the Errors should be selectable text. And if a complete error is selected, it would be nice, if the type/severity would be appended (well, as prefix, so the other way around, hehe). The toolbar button is unecessary too, for really, the text should be selectable.

The reason you can't currently copy from the error list is because of the design decision to use a listView to display these. To be honest, the ability to copy the text at all was only there to make reporting bugs a bit more convenient - do you have another use case in mind ?

Why is the fontsize of the editor so huge? Ok, fontsizes are always tricky, so it would be nice if we could set our own.

You can :-) Either use CTRL-mouseWheel or change the font under Settings/Fonts and Colours. I'll do some work on improving the default colour/font scheme before a proper release.

As to bug reporting: do you accept it if we submit already created scripts/functions (in full) as examples (together with a short note) or do you insist on small artifical demos?

It's really your choice. The first thing I always do with submitted code is try to cut it back to the simplest possible section that still demonstrates the problem. If you've done this first it saves me a few minutes but I'm not bothered if you just paste in the entire file. (If you weren't aware, it's easy to trim back the file because the errors are now recalculated as you cut stuff out of the code window.) Basically, I'd rather get a bug-report I have to spend a little time on than no bug at all :-)

Oh and while we're at it: what does No matching signature for... mean? For example:

It usually means that you have tried to call a function with the wrong kinds of arguments. For example...

_a = "a string" ;

getdir _a ;

The reason you are seeing it a lot at the moment is because I'm still working on the type-analysis so you'll often get these errors if you are using (what squint thinks are) unitilialised variables. Eg

private ["_a"];

getdir _a ;

will give an error because _a is <unused>. This will be tidied up over the next few days.

>Fix: Change/Insert 'private' array here?

This normally occurs when squint detects that you either have used variables which ought to be declared private (in which case if is offering to add them to the private array for you) or if you have not used variables that were declared in the private array (in which case it is offering to remove them for you).

If you press the 'fix' toolbar button you'll notice the contents of the highlighted private array change.

And how to interpret "fix" anyway? Whats that for a "severity"?

A 'fix' is an item where squint can automatically fix up your code. For example... if you write

private [a,b,c]

in the code window, you'll notice a number of 'fix' items in the error list. If you highlight these in turn and press the 'fix' toolbar button, you'll see the code gradually transform itself into

private ["_a","_b","_c"];

I agree that the availability of a 'fix' is somewhat orthorgonal to the underlying severity - I'm thinking of ways to improve the display here.

Hope that helped - I really do appreciate the feedback (and bug reports) - keep it coming :-)

Share this post


Link to post
Share on other sites
Could you explain what you mean? [toolbar ...]

The first time the programm started up, the toolbar (or button-groups) was already cluttered over three lanes (vertically). Thats on a win xp box, where the toolbar buttons probably get rendered bigger than on your OS... and then the default positions do probably not account for this.

Second, and here comes the "buggy as hell", trying to put the toolbar-groups back on one single horizontal lane was a nightmare. The draging of one button-group may cause any other button-group to flip down if they touch, creating new lanes again... Therefor the suggestion to only allow one lane. That would stop the most annoying feature of this - the creating of a new lane.

Is it really necessary that the toolbar may be shuffled? I guess a fixed default toolbar would do aswell. I hate it when toolbar-elements jump around accidentally.

[... copying errors] do you have another use case in mind ?

Well, the first thing I usually do if I encounter some strange error (from any programm), is to google that error. So beeing able to copy errors is always a good idea. Selectable text is the answer.

And since I can imagine that especially beginners will be glad to use your tool, they probably won't understand the errors straightaway. With time, googeling for these error messages will show a quick answer on what they mean and how to solve or circumvent them.

It usually means that you have tried to call a function with the wrong kinds of arguments. For example...

Uhm, pardon me, but isn't this approach doomed to fail?

private ["_a", "_b", "_c", "_something"];
_a = _this select 0;
_b = _this select 1;
_c = _this select 2;

_something = {
  ((_this select 0) + (_this select 1))
};

(format ["%1 %2 %3 %4", (_a * 7),  _b,  _c, ([_b, _c] call _something)])

What now? :D

Nothing is strongly typed in BIScript (which is a good thing in any scriptlanguage), sooo.... screw types? no?

"... call a function with the wrong kinds of arguments"..

^^ I smell heck of a lot of false positives.

But hey, if you have a plan...! ;)

Share this post


Link to post
Share on other sites
>Second, and here comes the "buggy as hell", trying to put the toolbar-groups back on one single horizontal lane was a nightmare. The draging of one button-group may cause any other button-group to flip down if they touch, creating new lanes again... Therefor the suggestion to only allow one lane. That would stop the most annoying feature of this - the creating of a new lane.

Ah - gotcha. I'm using the .Net ToolbarGrid component which seems to be a bit rubbish to be honest. If nothing else I'll try and ensure that the default layout is sensible.

Well, the first thing I usually do if I encounter some strange error (from any programm), is to google that error.

Fair point - I'll look at different approaches for the error list.

Uhm, pardon me, but isn't this approach doomed to fail?

Not necessarily. In the cases where type can't be determined, it will be set to 'Any' which means it will match any signature. In practice I'm finding that very large sets of scripts (eg BIS mission scripts) can be parsed with very few false positives. The ones you are currently seeing are a temporary artefact of the way that undefined or external variables are handled. Ie, if you have a script which uses _someVariableWhichWasAssumedToBePresentInTheCallingContext you will see a "no matching signature" error. In future you will probably just see an '_someVariable... may not be in scope' error and _someVariable will be assumed to be of type 'any' for the purposes of type-checking.

To take this example (based on yours above)

func={

_a = _this select 0;

_b= "some text" ;

_c=_a*b;

};

[1] call func;

Squint currently assigns _a to be of type 'Any' (because indexing into any array returns 'Any') and assigns _b to be of type "string", thus flagging an error for _c because you can't mulitple anything by a string. In future, I hope to be able to arrange things so that squint can trace through the "[1] call func" and deduce that _a is intended to be a number.

Edited by sbsmac

Share this post


Link to post
Share on other sites

Can't install it. .Net Framework installation gives me an error when it finishes...

Share this post


Link to post
Share on other sites

I appreciate some people feel strongly about this but it's really much easier for me to distribute (and keep up to date ) using Microsoft 'ClickOnce' deployment. This installs stuff to your %appdata% directory. You can easily remove it using add/remove programs. There are no shortcuts created but there is a link created under 'Macs Tools' in the start menu.

I'm sorry - I would love to try this, but such an implementation makes it a no-go for me. I (strongly) prefer to work "portable" without things like you mention. It is actually possible to work with .net relatively portable, but the app itself should also be. (I log in as admin only rarely.)

I am, however, VERY interested in what you are doing, and think it is great! :) I was just mentioning elsewhere that I spent more than an hour trying to debug an issue where I'd forgotten a }; to close out a conditional. Not just once, but TWICE! :)

So, I'm sure people will be interested in what you are doing, I'll personally just wait and see how it develops.

Share this post


Link to post
Share on other sites

Just to clarify something, ClickOnce doesn't require Administrator access. In fact it's really far more 'portable' than standard applications since it doesn't clutter up your 'program files' directory but instead uses %appdata% which is already designed to be a temporary area for program data. My motivation in using it is simply that it makes it trivial to push out updates to users which removes one of the main sources of frustration when developing these kinds of tools, ie never being sure that issues being reported are being seen with the latest version rather than some ancient release.

Anyway, I'm glad you can see the potential :-) Squint is already capable of catching all syntax errors - the missing braces you mention would have been immediately reported by squint as would things like missing semi-colons, or any of the following...

if (_a==5) _b=6 ;

while (_a<10) do {

_a = _a+1;

} ;

if (_a==objNull) then {

_a=player;

};

for _a from 1 to 2 do {

} ;

and a lot of other errors :-)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×