Jump to content
Sign in to follow this  
sbsmac

Squint - the sqf editor and error-checker

Recommended Posts

Can I just remind everyone that mac belongs to SBS. He's signed a contract for life and no one is allowed to have him. :D

good stuff mac!

Share this post


Link to post
Share on other sites

Oh no, now I'm trouble! Forgot to get a permission-slip from taxman before going awol for my little 'holiday project' :j:

Edited by sbsmac

Share this post


Link to post
Share on other sites

This is amazing stuff! The best scripthelper created over the last 10 years. Love it!

Only problem I find is that it would so much better if you just released it as a .exe or made a standard installer that installs the program at a chosen path.

Instead of C:\Users\MyName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Mac's Tools\

This way one could associate the program with the appropriate files.

Other than that.. Amazing stuff!

Share this post


Link to post
Share on other sites

Thank you indeed - I had a good chuckle listening again to "song for bohemia". If you ever write one for squint it should probably contain the line "any colour you want as long as it's black" ;-)

I've already talked a lot about why I feel ClickOnce is a good choice for me but the ability to associate files is definitely an interesting point. I'll look at the possibility of adding some shell extensions (actually Tankbuster raised this some time ago on the official issue-tracker so it's on the 'todo' list).

Share this post


Link to post
Share on other sites

Ok, don't say I don't ever listen ;-) Line numbers are in. I won't bore you with how many hours I wasted before discovering that rich-text simply can't handle non-integer sized fonts, just hope you like the end result....

linenumbers.PNG

I had to rewrite the way zooming of text-boxes works in order to get this going properly. If you are in the habit of using CTRL-mousewheel to zoom in and out you will probably find your codewindow textsize has reset itself when you restart.

Edited by sbsmac

Share this post


Link to post
Share on other sites

Mouse whell dont work in "text" window. If i click by whell in window, i can list it moving mouse, but when i simple rotate whell after click LMB or RMB - there is no reaction.

You didnt fix my ask about #define?

Share this post


Link to post
Share on other sites

Here is something I found to appear correct though it does not evaluate as I expected, maybe it is something you can work with.

if ((_empty && _moved || _disabled || !(alive _vehicle)))

Does not work the same as:

if ((_empty && _moved) || (_empty && _disabled) || (_empty && !(alive _vehicle)))

Empty is ignored in the first example.

However this does work:

if ((_empty && (_moved || _disabled || !(alive _vehicle)))) then {

Share this post


Link to post
Share on other sites

First off, fantastic application. Many thanks!

Mouse whell dont work in "text" window. If i click by whell in window, i can list it moving mouse, but when i simple rotate whell after click LMB or RMB - there is no reaction.

I think I'm making the same point... scrolling with the mouse-wheel in the text window doesn't work in this version (can't recall if it did before or not... have only spent 5 minutes with the program thus far :)).

Also, is there any way to exempt certain functions from erroring? E.g. Some of the compiled BIS functions show up as errors (e.g. BIS_fnc_spawnVehicle)... and also, obviously, things like CBA functions (e.g. CBA_fnc_globalExecute).

Share this post


Link to post
Share on other sites

Wass- thanks for the report about the mouse-wheel. Will put this back in today. I'm afrad I haven't added support for 'bare' filenames yet. It is on the list (http://dev-heaven.net/issues/13134#change-63583) but there is quite a lot of other stuff there as well so it may take some time :)

Callihn. Sorry but if I've misunderstood but I think you are suggesting that squint could be warning of something like "this expression may not evaluate as you expect, use more brackets" when it sees....

_empty && _moved || _disabled || !(alive _vehicle)

?

This is a good suggestion. It already does this for some 'tricky' operators and I'll think about how to apply it in the above circumstances. In the meantime, it may help you to know that Arma will evaluate operators of equal precedence in order from left to right. So this will be treated as

( (_empty && _moved) ||

_disabled )

|| !(alive _vehicle)

(Ironically the one place that brackets are used in the original statement, around the "alive vehicle", they are not required.)

You can check on how squint thinks arma will evaluate your expressions by moving the mouse over an operator (eg the first '&&') and right-clicking to bring up the pop-up menu. Then choose 'highlight operands' and in this case you will see that the '&&' only

works on _empty and _moved. If you do the same with the first '||' you will see that "_empty && _moved" is treated as the first operand and "_disabled" as the second for that "||" etc...

---------- Post added at 09:31 AM ---------- Previous post was at 09:24 AM ----------

JamesF1, no, mouse-wheeling was broken yesterday when I added line-numbers (technical digression.... there was a major problem getting line-numbers to line-up corrrectly with the text in the code-window, for some reason different-size fonts were being used in the two windows. After much hair-pulling I deduced that non-integer font sizes were being rounded up in the rendering path for the code window. Easiest way to fix this was to disable mouse-zoom and use some custom code to scale the fonts instead. But I forgot to add support for basic scroll back in !)

>Also, is there any way to exempt certain functions from erroring?

Yes, this is a known problem and easy to fix - I just need to get to my 'main' PC for a few hours to compile a list of the BIS functions. Will also talk to sickboy about getting a list from CBA.

Share this post


Link to post
Share on other sites
scrolling with the mouse-wheel in the text window doesn't work in this version (can't recall if it did before or not... have only spent 5 minutes with the program thus far :)).

It did before, but you still had to click in the window. Would be nice if the app could recognize which part the mouse was over and scroll that window without actually having to click. Easy to "miss" the location you were typing in by accidentally clicking somewhere else.

Share this post


Link to post
Share on other sites
JamesF1, no, mouse-wheeling was broken yesterday when I added line-numbers (technical digression.... there was a major problem getting line-numbers to line-up corrrectly with the text in the code-window, for some reason different-size fonts were being used in the two windows. After much hair-pulling I deduced that non-integer font sizes were being rounded up in the rendering path for the code window. Easiest way to fix this was to disable mouse-zoom and use some custom code to scale the fonts instead. But I forgot to add support for basic scroll back in !)

Fair enough :)

Yes, this is a known problem and easy to fix - I just need to get to my 'main' PC for a few hours to compile a list of the BIS functions. Will also talk to sickboy about getting a list from CBA.

If it helps, you can also use BIS_fnc_help when running A2 to get a list of the CBA functions (I'm sure you already knew that, though)... alternatively, the command reference for CBA lists everything.

Share this post


Link to post
Share on other sites

Callihn. Sorry but if I've misunderstood but I think you are suggesting that squint could be warning of something like "this expression may not evaluate as you expect, use more brackets" when it sees....

_empty && _moved || _disabled || !(alive _vehicle)  

?

This is a good suggestion. It already does this for some 'tricky' operators and I'll think about how to apply it in the above circumstances. In the meantime, it may help you to know that Arma will evaluate operators of equal precedence in order from left to right. So this will be treated as

( (_empty && _moved) ||
_disabled ) 
|| !(alive _vehicle)  

(Ironically the one place that brackets are used in the original statement, around the "alive vehicle", they are not required.)

Yea, that was the thought I was having and strangely enough it treated it as:

( (__moved || _disabled || !alive _vehicle))

It didn't care if it was empty or not, real fun taking off in a jet when it kicked in. ;)

Share this post


Link to post
Share on other sites
alternatively, the command reference for CBA lists everything.

That's very useful, thank you!

Share this post


Link to post
Share on other sites

As a minor additional point, the tooltip for the button left of "Reload all Files" (what I can only presume to be "Reload this File") has the default tooltip "toolStripButton18".

Share this post


Link to post
Share on other sites

Even stranger is that in the other two code examples, it only seems to care about empty as if I watch carefully vehicles which have not been moved nor damaged start respawning, maybe I've set the movement too sensitive at > 0, I dunno. Anyway, so I guess I'll be sorting that out. :eek:

Also now when I hit the get help for errors it no longer opens that web page.

Share this post


Link to post
Share on other sites
Also now when I hit the get help for errors it no longer opens that web page.
]

Hmm - the toolbar button works but I must have forgotten to wire up the items in the help menu - will be fixed in next release.

Share this post


Link to post
Share on other sites

Right, really delving into this application now. One bug to mention: when the application inserts 'private' declarations, the new-line is in the wrong place, e.g. you end up with:

 
private ["_myvar"];hint "Peanuts";

Instead of:

private ["_myvar"];
hint "Peanuts";

Also, I have a couple of 'requests' - don't know how many of these have been suggested before, or that you've planned, or that you've ruled out already. None of them are 'critical' but they are things I'd love to see at some point :)

Fonts & Colours

  • "Real-time" preview of the colour/font changes
  • Support for OpenType fonts (as an example, I love Inconsolata as a programming font, and use it exclusively).
  • Enable customisation of the entire styling of each type (e.g. I dislike the italics on comments).
  • Increase the styling options to the project and error panels, too.
  • Allow export and import of font/colour sets (a lá Visual Studio), to allow us to share good configurations (or to move them between installs, etc).

Other Areas

  • Small documentation snippet on hover (e.g. maybe including the "Syntax", "Description" [max. 150 chars or so] and "Return Value" fields from the Biki for known commands).
  • Option to set a 'working directory' for a project, so project paths (in the left-hand panel) are relative to the working directory rather than absolute.
  • Search & Replace

I'm sure I'll come up with more over time (I'm sure you're thrilled at that prospect :p :o).

Share this post


Link to post
Share on other sites

JamesF1,

The private indentation has been mentioned a few times by other people. It's mildly annoying but actually quite hard to fix (grammar analyser does not have access to formatting info and only operates on a stream of expressions which has whitespace discarded). Bug at http://dev-heaven.net/issues/12934

* "Real-time" preview of the colour/font changes

Enable customisation of the entire styling of each type (e.g. I dislike the italics on comments).

* Increase the styling options to the project and error panels, too.

* Allow export and import of font/colour sets (a lá Visual Studio), to allow us to share good configurations (or to move them between installs, etc).

Interesting side-note. When I first started writing squint it was with the intention of making a CLI backend static-analyser. Soon realising that 90% of scripters would not understand or use such a tool I decided to add a rudimentary gui and basic editing capability so people could fix the problems it found a bit more easily. Now I'm hoist by my own petard (yes, I did rather ask for this by advertising squint as an 'editor') and people keep asking for the GUI to be improved to the standards of a professional editing suite. ;)

Anyway all good suggestions and added as http://dev-heaven.net/issues/13205

* Support for OpenType fonts (as an example, I love Inconsolata as a programming font, and use it exclusively).

*

I use a standard FontDialog and according to the documentation it should offer any OpenType fonts you have installed. If you have any ideas let me know -I'm not much of font expert!

* Small documentation snippet on hover (e.g. maybe including the "Syntax", "Description" [max. 150 chars or so] and "Return Value" fields from the Biki for known commands).

Yep good idea - http://dev-heaven.net/issues/13206

* Option to set a 'working directory' for a project, so project paths (in the left-hand panel) are relative to the working directory rather than absolute.

The whole file-list concept needs rethinking wrt paths, especially since you can create a project from a pbo and edit files within it (even binarised files within a pbo). I have some vague ideas that involve treeviews... http://dev-heaven.net/issues/13207

* Search & Replace

There's already search but I agree S&R woudl be good, even global S&R. There's already a 'refactor' suggestion at http://dev-heaven.net/issues/12589

I'm sure I'll come up with more over time (I'm sure you're thrilled at that prospect ).

Actually the worst thing for a developer is lack of feedback and suggestions show that people think the product is good enough to be improved so whilst I may sometimes sigh inwardly when I see yet another request to change the default background colour from black (!) , really I appreciate the fact people are using the tool. :)

On a practical matter, I'm starting to drown in a long list of helpful suggestions and bug-reports (as well as the nice comments which are always appreciated!). I'll always do my best to 'scrape' these from this forum but those of you who are willing to take 5 minutes to register at http://dev-heaven.net/ can help me a lot by opening tickets on the official issue-tracker for squint (http://dev-heaven.net/projects/squint/issues).

You don't even have to remember this link:- there is a 'Bug reporting' menu which offers the useful option to 'report bug'. When you do this the contents of the code window as well as details of any error in your code are copied to the clipboard and your browser is opened to the issue tracker where you can paste them in if relevant ! :)

Edited by sbsmac

Share this post


Link to post
Share on other sites
On a practical matter, I'm starting to drown in a long list of helpful suggestions and bug-reports (as well as the nice comments which are always appreciated!). I'll always do my best to 'scrape' these from this forum but those of you who are willing to take 5 minutes to register at http://dev-heaven.net/ can help me a lot by opening tickets on the official issue-tracker for squint (http://dev-heaven.net/projects/squint/issues).

It just won't let me. Changed my password 50 times now and I still cannot login. Yes I am using the correct username. I officially declare dev-heaven evil and discriminating against me'es.

Nevermind created a user with same name and got it worked :rolleyes:

Nevermind the nevermind, won't let me login again now... sigh...

Edited by Muzzleflash

Share this post


Link to post
Share on other sites
Anyway all good suggestions and added as http://dev-heaven.net/issues/13205

I'll post 'em on Dev-Heaven in future, for you :)

I use a standard FontDialog and according to the documentation it should offer any OpenType fonts you have installed. If you have any ideas let me know -I'm not much of font expert!

I'm not really familiar with the FontDialog, as I have rarely had use for it in the majority of .NET work I've done... but when trying to load any OpenType font, I get an unhandled exception saying it only takes TrueType fonts.

There's already a 'refactor' suggestion at http://dev-heaven.net/issues/12589

Looks good to me :)

Actually the worst thing for a developer is lack of feedback and suggestions show that people think the product is good enough to be improved so whilst I may sometimes sigh inwardly when I see yet another request to change the default background colour from black (!) , really I appreciate the fact people are using the tool. :)

I know the feeling well - the outright worst situation, for me at least, is criticism of your software without any form of constructive input!

On a practical matter, I'm starting to drown in a long list of helpful suggestions and bug-reports (as well as the nice comments which are always appreciated!).

If you ever feel like 'outsourcing' a few parts to others (such as those not so tied up in the lexer, or such), I'm sure there are a number of people around who have experience with .NET (myself included) who could contribute in some way... even if it's just research-related. :) Personally, I couldn't promise much time, but well, the offer's there.

Share this post


Link to post
Share on other sites

Very strange - I can only suggest you contact sickboy or one of the admins to figure out what is going on there :-(

In the meantime 1.0.0.82 is released with the following fixes...

*Bug #12897: Bug reporting should not prompt for a switch to preprocessed view.

*Bug #13202: tooltip for "reload current file" missing

*Bug #13203: settings/paths and colours should take affect immediately

*Bug #13208: Menu items for "Show command reference" and "help on errors" did not work

Edited by sbsmac

Share this post


Link to post
Share on other sites

[shameless bump of my own DH ticket]

Is there any chance we might get shell integration? It would be ever so cool to right click on a file in explorer and have it sent straight to Squint.

Share this post


Link to post
Share on other sites

Linenumbers should display at least 3 digits.

Using courier new only 2 digits are visible. Could not find a way to resize that line number area.

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  

×