Jump to content
Sign in to follow this  
sbsmac

Squint - the sqf editor and error-checker

Recommended Posts

Obviously some of you never had to work with white/green on black monochrome 40x25 monitors back in the day..... ;-) And you should be grateful I changed the font away from 'Comic Sans' which I'd been using as a placeholder during development.

HaHaHaHa! Yea, seriously, it was not just the monitors getting burn in.

Can you be a bit more specific ? Are you talking about the "File->add to project->Folder" browser ? It's a bit rubbish - will look at changing it. Tbh I never use "File-add To project", it's much easier just to drag files, folders or pbo's from the desktop into the file-list to add them to the project.

Yea, that's the one, sorry, didn't know you could drag. :o

BTW, why does it keep coughing at these?:

#include "Scripts\TeamStatusDialog\TeamStatusDialog.hpp"

Says: "Missing semi-colon or operator"

Also, right click copy and paste might help allot of folks and perhaps a switch to hpp/sqf mode there too someday.

But again, it's wonderful, just shaved some time off for sure and fixed quite a few issues as well. :yay:

Share this post


Link to post
Share on other sites
BTW, why does it keep coughing at these?:

#include "Scripts\TeamStatusDialog\TeamStatusDialog.hpp "

Says: "Missing semi-colon or operator"

There's something it doesn't like inside that included file. The easiest way to figure it out is to switch to preprocessed view (the '#' toolbar button) and highlight the error. Note though you can't edit stuff in preprocessed view for the reasons outlined in the FAQ

Also, right click copy and paste might help allot of folks and perhaps a switch to hpp/sqf mode there too someday.

CTRL-C, CTRL-V, CTRL-X all work in the code-window :-) You can switch between cpp/sqf mode by right-clicking on the filename in the file-list. The choice of grammar is persistent so it'll be remembered next time you start up the project. The fact that hpp files start in 'sqf' mode is a bug which I'll fix shortly.

Share this post


Link to post
Share on other sites

Squint save lives people! Use it.

Especially if you can't count/match your brackets and braces. :)

Share this post


Link to post
Share on other sites
Especially if you can't count/match your brackets and braces.

Just added a new feature just for you ! Right-click anywhere in the code-window and select 'highlight bracketed area' and the squint will highlight the extent of the immediately-surrounding brackets. This works with normal brackets '(', braces '{' and arrays '['. :)

Share this post


Link to post
Share on other sites

LOL, just for me? Are you suggesting I'm the only muppet who can't count? :D

Share this post


Link to post
Share on other sites

This is awsome. Good job, very handy indeed. :)

Share this post


Link to post
Share on other sites

Thank, that is nice :) But I can not setup in because it says that it nedd 1.6 Gb free space. I have it but not on drive C, and seems, it wants to install there.

Share this post


Link to post
Share on other sites

1.6Gb -wtf ?!?! ;-) The app itself is somewhere between 300 and 400 Kb! Even .NET4 is probably only around 100Mb. Where is the message about 1.6Gb coming from ?

*Edit* Are you sure that the installer isn't prompting you to install windows first ? :-P

Edited by sbsmac

Share this post


Link to post
Share on other sites

Oh sorry didn't know you had a bug tracker where all the issues I posted were already on.

Share this post


Link to post
Share on other sites

Not all of them - a couple of things you reported were new :-) Anyway, new update fixes the following...

* Bug #13106: Add 'highlight matching brackets' feature

* Bug #12857: Need to catch orphan commas in arrays

* Bug #12912: Highlighting of comments in preprocessed view is incorrect

* Bug #13099: not detected script error (variable followed by a string, but not delimited by a comma - inside array definitions!)

* Bug #13103: Default grammar for hpp should be 'cpp'

Share this post


Link to post
Share on other sites

Great

I would like to know how you see the usage of squint.

1. A static analyzer only with very limited editing capabilities to just fix bugs?

2. Above however with slightly more capable editing capabilities?

3. Other?

If 2 or 3 (depending on 3), would you consider adding auto completion? I did not see that request on the tracker and think unlike my N++ which has only auto completion for known keywords you can auto complete locals and globals, and maybe macros too since you detect types?

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

Originally the concept was that squint would be a back-end static-analyser tool like 'lint' (Indeed, I will probably release a command-line standalone version at some point.)

However I've come to see it as more of an editor with interactive static-analysis and will almost certainly be adding to the editing capabilities. I now tend to use squint as my main editor for sqf despite otherwise being a die-hard emacs user.

Working with Visual Studio and Intellisense has really given me an appreciation for auto-completion and the advantage squint has is that it should be able to do this in more of a 'context-aware' fashion than basic editors. Your example of local variables is a good one and squint could also do things such as suggesting function names for 'call' or adding 'electric brackets' (if you've ever used emacs you may know about this.)

Anyway, added to the list as http://dev-heaven.net/issues/13109

Share this post


Link to post
Share on other sites

Thanks for the screenshots guys but I only accept entries to the competition if accompanied by a user.config file since I don't have the time (or necessary artistic eye!) to try to match your screenshots against the names of windows colours. :-)

Share this post


Link to post
Share on other sites
would you consider adding auto completion?

I've just added a rather experimental implementation in v1.0.0.71

It's off by default and to enable it you have to go to the 'advanced' menu and check "Enable keyword prediction"

At the moment it only knows about reserved keywords but it's easy to extend it to know about local variables, global variables and function names.

You can probably break it if you try hard enough ! If you do, let me know.

Start typing "dis..." You'll see the list of acceptable completions narrow as you type more characters. Use up/down arrow keys to select one of the completions. Press ENTER to autocomplete with the selected option.

Press ESC to banish the box.

Share this post


Link to post
Share on other sites

Great job :).

I've broke it on my first keypress :o. Pressing enter at end of line seems to cause it to fail with: "Object reference not set to an instance of an object".

More detailed:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
  at squint.AutoComplete.CharTyped(KeyEventArgs c)
  at squint.Form1.richTextBox1_KeyDown(Object sender, KeyEventArgs e)
  at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
  at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
  at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
  at System.Windows.Forms.RichTextBox.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
System
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 built by: RTMRel
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
squint
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase: file:///C:/Users/S%F8ren/AppData/Local/Apps/2.0/KKCVVVH6.8KB/855TTKOK.H7Q/squi..tion_3d804d6cf9fd5b6a_0001.0000_ff5eb78b675e61bd/squint.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 built by: RTMRel
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 built by: RTMRel
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Mac.Arma.FileFormats
   Assembly Version: 0.0.0.0
   Win32 Version: 0.0.0.0
   CodeBase: file:///C:/Users/S%F8ren/AppData/Local/Apps/2.0/KKCVVVH6.8KB/855TTKOK.H7Q/squi..tion_3d804d6cf9fd5b6a_0001.0000_ff5eb78b675e61bd/Mac.Arma.FileFormats.DLL
----------------------------------------
System.Configuration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 built by: RTMRel
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 built by: RTMRel
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Deployment
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------
System.Core
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.1 built by: RTMRel
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
mac.XML
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase: file:///C:/Users/S%F8ren/AppData/Local/Apps/2.0/KKCVVVH6.8KB/855TTKOK.H7Q/squi..tion_3d804d6cf9fd5b6a_0001.0000_ff5eb78b675e61bd/mac.XML.DLL
----------------------------------------

Some kind of hotkeys for activation perhaps in later versions? I sometimes use the arrow keys to move the caret around. Doubt i'm the only one. On activation the arrows keys are allowed to be "taken" of course?

I did get it working by pressing continue and start on a fresh line, however.

Share this post


Link to post
Share on other sites

Lol- I hadn't expected it to be thateasy to break ! The theory with the arrow keys is this...

Once auto-complete is active, arrow keys are bound to it. You can easily unbind them though by pressing ESC to cancel auto-complete. This system seems to work pretty well for MSVC. Anway, I'll take a look at the breakage and fix it up in a while.

Share this post


Link to post
Share on other sites

My bad. Just fired up MSVC and that indeeds work well.

There is one difference though. MSVC only gives the autocompletion if you actually write a character. Here pressing the up-arrow with nothing written gives the autocompletion box anyway, giving you only the mouse for moving the caret, even if you just want to go one line down or up.

And the ESC doesn't help in this situation. Since it just closes the window and it pops up on next press again.

Share this post


Link to post
Share on other sites

Ok - give the new version a try.

Share this post


Link to post
Share on other sites

Yeah now it works. Agile Development ftw. :bounce3:

One small nitpick. Whenever you move the caret left and it "passes" through non-whitespace a "%" appears as a viable autocompletion, thus preventing vertical arrow movement. What is this % for? Is it for format statements?

Share this post


Link to post
Share on other sites

This Tool looks great ! :)

One question:

Squint uses ClickOnce deployment which means that it will always keep itself up to date and you don't need to worry about checking for new versions.

What does this mean exactly ?

Is this some kind of AutoUpdate i can deactivate in a Menu or something else ?

Share this post


Link to post
Share on other sites
This Tool looks great ! :)

One question:

What does this mean exactly ?

Is this some kind of AutoUpdate i can deactivate in a Menu or something else ?

It is the way the program get's deployed. You download a small setup file which brings up a windows where you can choose to install.

Regarding the autoupdate. I think it is an autoupdate that you can't disable in the menu.

Share this post


Link to post
Share on other sites

@ Muzzleflash

...now im even more confused... ;)

You download a small setup file which brings up a windows where you can choose to install.

Isnt this the way every installer works ?

Regarding the autoupdate. I think it is an autoupdate that you can't disable in the menu.

Thats something i dont like. I normally disable all auto updates...i dont like it if there is something going on in the background while playing or working on the PC.

Share this post


Link to post
Share on other sites
@ Muzzleflash

...now im even more confused... ;)

Isnt this the way every installer works ?

Thats something i dont like. I normally disable all auto updates...i dont like it if there is something going on in the background while playing or working on the PC.

ClickOnce is not the typical installer in that it as far as I know does not contain the program. You download this "setup" file that ask you if you want to install. If you do then the program gets downloaded and installed.

Whenever you run the program it checks for update and install that if available. Maybe you can disable this update by using your firewall I don't know haven't tested. This update isn't run on random. It is checking everytime you start the program only. So it won't disturb you during gaming or other activities. The check only takes 1 or 2 seconds here then the program starts, unless there's large updates then it might take up to 10s total to download/install the update and start.

This method of installing and updating a .NET program I think is what's called ClickOnce.

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  

×