Jump to content
Sign in to follow this  
sbsmac

Squint - the sqf editor and error-checker

Recommended Posts

Sorry, it's been a while since I posted- the back has been giving me considerable grief over the last couple of days so not much coding. Anyway....

@Katrician

>Editing the .ext file with Squint, it wanted to remove equal sign(s) where there was no text after the equal sign e.g

Actually what it's really complaining about is that expects you to have written Text=""; I still need to teach squint about some of the 'odd' assignments that can be found in cpp/ext files.

>File is saved and when I reopen it I got this (happens usually with large files):

Definitely a line-ending problem. It sounds like you may be using a program which is introducing a mixture of unix and dos line-endings into your file.

@callihn

>I'll mention this again too, everytime you open a file it warns you have changes before you can close even when no changes have been made,

It sounds like it is warning you that you have made changes to the _project_. When you drag a file across you are effectively adding it to the new project and squint is warning you that exiting will lose changes to the file-list. I find this mildly annoying myself but have yet to come up with a good policy for disabling it.

>also I just noticed that when I drag a folder into it nothing happens anymore. The latter appears to be selective though as it's working after I closed it and restarted it.

Couldn't reproduced. Only files with recognised file extensions are added to the list though. Maybe that's what you are experiencing ?

>Also it still errors on global variables knowing full and well that it can not read global space

Sorry, don't understand what you mean here.

>and it still counts cautions about comparision strings and case as errors.

No- it counts them as warnings.

>It also errors as missing semi-colon or operator after the word class for some reason, but that may just be .fsms.

Example ?

>Does not seem to even add description.ext to the files?

Well spotted - fixed.

@F2k_sel

>I'm not sure I can get used to the interface but time will tell.

You'll need to be a bit more specific if you have improvements in mind ;)

>Also where is the program located

In the Application Data folder (this is where ClickOnce stores deployed executables).

@Delta

>Vinculate project file to a mission directory from Arma, is better to organize with project file in mission directory

Hmm - I think google translate has let you down on this one - can you explain a bit differently ? :)

>Recent files/Projects for fast access

Agreed this would be nice. You can use the shell integration as a partial replacement though - just right-click on a project file to open it in squint.

>Better indentation levels using tabs (like Visual Studio Editor or notePad++)

>Block indentation using the key TAB and Shift-TAB

TAB already auto-indents the current line or block (just select the text you want to indent and make sure that auto-indent is enabled in Settings/Editor/Misc menu). You can also use the new custom-command utility (see below) to run an external beautifier.

>Better Find Function Editor with protection against acidental text change

Not sure what you are suggesting here- can you explain a bit more ?

>fix the syndrome of the code listing scared: the code lines skips arbitrarily, no explication...

Can you explain a bit more what you mean here ?

@Muzzleflash

>So what's new in 106?

Custom commands :) If anyone finds any particularly neat things to do with these please let me know the 'recipes' and I will post them on the squint site for others to share.

Edited by sbsmac

Share this post


Link to post
Share on other sites

I still can't work out how to save an sqf file with a different name, the save as option is now greyed out and un selectable.

Share this post


Link to post
Share on other sites

Sbsmac,

Sorry, my english is not good enough, but i keep learning.:D

FIND

When I use the FIND function, this function selects all the text founded, after , if I type in error, I will delete the word that I had found. this can lead to undesirable changes in the code or involuntary.

TAB

TABs only works with { and }, I can not use the TABs without these symbols in the code.

TAB Block

I have strange results when I use TAB and Block, parts of the text are at different levels...:(

UNDO

Ctrl-Z is Strange, the cursor skips for a first line of source... This is a syndrome...:p

Best Regards!

Share this post


Link to post
Share on other sites

I am loving this editor, it has helped a great deal with errors and such. However just a request. Im not sure how easy it would be to implemented it however, and how long it may take.

You already have the system there, when you type for example...

unit set

It comes up with suggestions for the code you are looking for. How about having suggestions for the bits after the code... such as variable's, strings, array's etc.

Like i said im not sure how easy it may be...

for example you type

unit move getMarkerPos ";
or
unit move getMarkerPos _;

As soon as you press " the code will scan the mission.sqm files for any markers (string name such as "house1" or "blowup") in game that has a name and brings up a suggestion box or if you type _ then it will scan the current script for any variables or by checking any scripts link to the current one for variables and brings up a suggestion box. Or if you type a certain array thingy, it would bring up suggestion the system would think that would work in the array.

This will help people who has SOOO many variables. It would be useful for create groups, for missions with LOADS of groups, and among other things.

The reason i came up with this idea is because thankfully enough you have a system which check if a variable is being used in a script. And if it isnt being used, then it would advise you to remove them, so it seems the system gathers all known variables. Maybe the idea i propose will gather all known variables, strings and arrays.

Sorry if its hard to explain. Its late lol.

Share this post


Link to post
Share on other sites

@Delta

Sorry, my english is not good enough, but i keep learning.

Your english is considerably better than any other language I speak so no need for apologies :)

>When I use the FIND function, this function selects all the text founded

Understood. This behaviour is actually consistent with editors such as notepad. I'll think about introducing a floating 'find' dialog though more similar to VS.

>TABs only works with { and }, I can not use the TABs without these symbols in the code.

TAB is not compatible with auto-indent so you can either use TAB by disabling auto-indent (Settings/editor/misc) or use auto-indent.

>I have strange results when I use TAB and Block, parts of the text are at different levels..

This could be the result of using hard-tabs in your files. If this is the case you can use "Tools/Convert tabs to spaces" to remove the tabs and replace them with spaces. If things are still messed up after this, can you post an example ?

>Ctrl-Z is Strange, the cursor skips for a first line of source... This is a syndrome..

Hmm - still not quite understanding this one :)

@WoodyUk

Glad you like it! Auto-complete already has some intelligence. It knows the difference between function-names, global variable names and local variable names and will try to offer you a sensible selection. So after typing "call" it will only offer function names as a completion.

The idea of looking for marker names is an interesting suggestion. Beyond that, looking at arrays is tricky since almost anything can go in an array !

Share this post


Link to post
Share on other sites

Still can't install it on Windows 7 64-bit (<- could this be the problem?).

Share this post


Link to post
Share on other sites

Hey zwobot I have it installed on Windows 7 64-bit noo problem. I don't have UAC on. Maybe try running as administrator?

---------- Post added at 12:26 PM ---------- Previous post was at 12:22 PM ----------

And make sure you have Net4 installed zwobot :D

http://www.microsoft.com/downloads/details.aspx?FamilyID=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en

i cant remember if there is a specific 64-bit version of Net4. I seemed to already have that on my machine.

---------- Post added at 12:40 PM ---------- Previous post was at 12:26 PM ----------

@sbsmac

Im glad that the suggestions are something there to think about. I can see that there is already intelligence on there. You seem to have great logic in programming and scripting to be able to put this sort of thing together gratz :D.

About the marker thing, the logic of that should be simple?

Search sqm for type=marker get name of marker and puts them all into a list. And call the list when certain commands are used.

I think the same would work for units too.

Get type=USMCSolder (maybe have a complete list of soldiers squint would need to search for and the ability for users to add soldier names that squint can search for (addons etc)) and if it picks any of these names up, add the names of the soldiers to a list. Then call that list when the user insert certain codes, so they can choose the soldier they want for certain things.

Certain codes for example
player setPos [(getpos s

as soon as you type the s, it should search all units begging with an s. Same goes if you type _s it would search all variables (groups n stuff)

Sorry. I dont have programming knowledge of any kind, i just think about the logic behind it. But the logic is that it should work with anything, units, vehicles, markers, triggers etc.

As for an array, maybe you could have it should that when an array is called, you could get 3 boxes pop up side by side (or somewhere at the bottom/side as too many popup's would be annoying?), one of them titled "Units" second titled "_variables" and third titled "markers", and users can see exactly what they have in the missions, so in complex scripts they could just scroll through or type maybe the letter S and it filters everything out in those boxes to just show these things that has the first letter S.

Oh and maybe people have the option to turn it on or off depending on how complex their scripts are.

This is just ideas :)

Let me know if it's hard to understand. I just seem not to be able to explain things clearly later lol. :P

Edited by WoodyUK

Share this post


Link to post
Share on other sites

sbsmac I (we) need a feature that check blankspace inside " that would work like this :

BAD

" SbsMac"

BAD

"SbsMac "

BAD

" SbsMac "

GOOD

"SbsMac"

Because Squint ignore that error, that I got in my mission .sqm, also while editing a script where I have added many ammo and weapons, since I do it manually; blankspace do happens, and it is very hard to check it on multiples lines of code. When working on .ext file the blankspace error had O.A not working at all, so this is not cosmetic but very needed. :pray:

When opening a project it would be great to have files shown in alphabetically order e.g :

zsu.sqf

mission.sqm BAD

bravo.sqf

alpha.sqf

aziz.sqf

dac.sqf GOOD

deltachopper.sqf

mission.sqm

paradrop.sqf

It's ok when you have few files, but when you have twenty something files displayed, it takes time to search for the file you want to edit. :bb:

Share this post


Link to post
Share on other sites

No autofixing or suggestions for blankspaces though. Most of the time they are intentional. Only highlight on demand.

Share this post


Link to post
Share on other sites

Undo, undo, undo.

So far here is what I have found useful:

It makes it easier to add things to a private and saves typing.

It catches those nasty isnil errors.

Aside from that I still use Notepad++ and here is why and IMO what it is missing:

Bracket highlighting makes it easier for me to see that I have enough brackets and not too many.

It has masive undo powers, so I can change allot of stuff and go back when I screw it all up.

It saves all my files that I had opened for the next day right where I was working on them at, this is great for those times when you can no longer see strait and making it to the bed is going to be hard enough, the next day you can start right where you left off.

Edited by callihn

Share this post


Link to post
Share on other sites

Agree my top 5 requests is:

- "Perfect" indentation

- Undo's

- Matching brace hightligting

- "Same word" hightlighting

- Remember where I was looking in a document so I won't have to scroll down.

Share this post


Link to post
Share on other sites

WoodyUK, still thinking about the best way to do this.

Katrician - did you know you can sort files alphabetically by clicking on the top of the 'File' column in the file-list ? In fact you can sort by any column this way. :-) As CarlGustaffa says, just detecting strings with leading spaces may not be the right thing. Perhaps the best approach is to combine this suggestion with WoodyUk's and look for things which are unrecognised classnames ?

Callihn, MuzzleFlash, I'm confused that you think there is no undo. Have you tried CTRL-Z or ALT-BKSPC ? Maybe because the undo buffer is cleared every time you switch file in the code-window ? There is also a bracket-hightlighting function - just right-click in the code-window and use 'highlight bracketed area'. Or are you talking about 'dynamic' highlighting that works as you move the cursor over a bracket ?

'Perfect indentation' is probably best handled by using uncrustify as a custom command.

Anyway, 1.0.0.108 is now out which addresses some of these requests. You can now create multiple tabs in the code-window.

CTRL-T create a new tab

CTRL-W close the current tab

As before, clicking on a file in the file-list shows that file in the current tab (and loses any undo history for the previous file).

You can view different portions of the same file across multiple tabs if you want.

The number of tabs and position within them is saved as part of the project info.

I've probably broken a few things in doing this -let me know if you notice anything.

Other changes- squint is now better at understanding cpp files.

Share this post


Link to post
Share on other sites
Callihn, MuzzleFlash, I'm confused that you think there is no undo. Have you tried CTRL-Z or ALT-BKSPC ? Maybe because the undo buffer is cleared every time you switch file in the code-window ? There is also a bracket-hightlighting function - just right-click in the code-window and use 'highlight bracketed area'. Or are you talking about 'dynamic' highlighting that works as you move the cursor over a bracket ?

Perhaps because the undo does not show us that it is undoing, as in scrolling to that point and changing it back while we can see that it is being done?

Seems to be working now, maybe it was still working when I tried it, as I mentioned once it's impossible to know when it's checking files, haven't noticed if that has changed.

Highlighting a bracketed area is not the same as showing us the matching bracket or lack of one when we are left or right of a bracket and that is the best I can say it, to understand better you'll have to see Notepad++, though I think it is what you said, I find it very handy for those math strings (((linkThis)+(that)) / ((this) * (that))) if I place the cursor next to any of the ( or ) it shows me the one that opens or closes it, both in bold red and if it has no match it shows it in firebrick without the bold.

Just noticed the search and replace.

BTW, not sure how NP++ does it but I do not have to save anything I just close it and when I open it again the next day I'm right back where I left off.

BTW, I like this color scheme:

<Codeview>
<FontName>
 Courier New
</FontName>
<FontSize>
 10
</FontSize>
<Background>
 White
</Background>
<Highlight>
 Yellow
</Highlight>
<Default>
 Black;Regular
</Default>
<Comment>
 Black;Regular
</Comment>
<LocalVar>
 Black;Regular
</LocalVar>
<GlobalVar>
 Black;Regular
</GlobalVar>
<Operator>
 Black;Regular
</Operator>
<String>
 Black;Regular
</String>
<DeffedOut>
 Black;Regular
</DeffedOut>
<Macro>
 Black;Regular
</Macro>
<Number>
 Black;Regular
</Number>
<Other>
 White
</Other>
<OtherFontName>
 Courier New
</OtherFontName>
<OtherFontSize>
 8.25
</OtherFontSize>
</Codeview>

Also I find "scratch" to be an awkward pain, why not just use the standard new and we can just start a new file if we want to have scratch space?

Looking forward to making squint my main editing program rather than something I just throw code into for a checkup so that's what I am aiming at.

Edited by callihn

Share this post


Link to post
Share on other sites
BTW, not sure how NP++ does it but I do not have to save anything I just close it and when I open it again the next day I'm right back where I left off.

N++ uses sessions (stored in a xml file). For example if you open some files then you can save session in the file menu. Later you can load it.

The reason it remembers is because, unless you turn it off in settings, it treats whatever you have opened last as a session and load that session on start up.

Share this post


Link to post
Share on other sites
N++ uses sessions (stored in a xml file). For example if you open some files then you can save session in the file menu. Later you can load it.

The reason it remembers is because, unless you turn it off in settings, it treats whatever you have opened last as a session and load that session on start up.

Ohh then it must also account for crashes since I just click on the X when I'm done. Anyway, it is wonderful IMHO.

BTW, it might also be handy for those ArmA Edit fans if Squint could do that code suggestion thing it does, where it pops up possible matches to commands.

Also just thought to ask, but since Squint always calls home on start will it function without a network connection?

How do you select all?

Edit: The problem with the undo is that it is very limited, for example if I use fix inconsistant cases and it makes 9 changes I can not undo them.

Edited by callihn

Share this post


Link to post
Share on other sites
as I mentioned once it's impossible to know when it's checking files, haven't noticed if that has changed.

Check the status bar (bottom left). This displays any background activity; if it just shows the number of files, squint has finished working.

Highlighting a bracketed area...

Ok, I understand what you are referring to now.

BTW, not sure how NP++ does it but I do not have to save anything I just close it and when I open it again

Auto-save option is a good idea.

BTW, I like this color scheme:

Thx, will add to the download section athttps://sites.google.com/site/macsarmatools/squint/colour-schemes

Also I find "scratch" to be an awkward pain

The original reason was to make it easy for people to get started. Now that CTRL-T adds a new tab I tend to agree that the scratch concept could be revisited.

BTW, it might also be handy for those ArmA Edit fans if Squint could do that code suggestion thing it does, where it pops up possible matches to commands.

Have you turned on auto-complete (settings/editor/Misc)? This pops up suggestions for commands and even variable or function names. Or do you mean something else ?

Also just thought to ask, but since Squint always calls home on start will it function without a network connection?

Yes, the network check is purely for update, it will run fine if no network connection is found.

How do you select all?

Standard CTRL-A (CTRL-C/V/X all work as you would expect as well).

Edit: The problem with the undo is that it is very limited, for example if I use fix inconsistant cases and it makes 9 changes I can not undo them.

You certainly ought to be able to (and a quick test here seems to work). The undo-stack is cleared when you either 1) save the file to disk 2) Load a new file into the tab. Maybe this is what you are seeing ? (Actually I did just notice a bug with the fix-inconsistent-cases command in that it doesn't refresh the display after running - this was broken when adding the multiple-tab support).

Share this post


Link to post
Share on other sites

I've been tinkering a bit based on some of the feedback here. There are still a few more improvements to be made which should follow in the next few days. For the moment though, here are the changes between V108 and V109

* Squint version is now simply the 'minor' version from the full deployment version string

* Squint now displays the project-update page whenever the version is updated

* Squint now provides automatic bracket-highlighting as you move the cursor over brackets

* Custom commands can now capture and display stdout and stderr

* Fixed the 'fix inconsistent cases' tool

* Code-window tabs are now correctly redisplayed if the font and colour settings are changed

Share this post


Link to post
Share on other sites

Update is good :D Thanks for that matey :D

I have noticed something however... in description.ext i have this code

class CfgIdentities
[b][color="Red"]{[/color][/b]
class Bov
 	{
	name = "Lieutenant Bov";
	face = "Face04";
	glasses = "BlackSun";
	speaker = "Male02EN";
	pitch = 1.100Rnd_127x99_M2;
 	};

	class Young
 	{
	name = "Sergeant Young";
	face = "Face19";
	glasses = "";
	speaker = "Male05EN";
	pitch = 0.9;
 	};

	class Roadrunner
 	{
	name = "Private Roadrunner";
	face = "Face25";
	glasses = "";
	speaker = "Male04EN";
	pitch = 1.0;
 	};

 	class Smith
 	{
	name = "Coporal Smith";
	face = "Face65";
	glasses = "";
	speaker = "Male09EN";
	pitch = 0.85;
 	};

	class Jagger
 	[b][color="#ff0000"]{[/color][/b]
	name = Corporal Jagger";
	face = "Face13";
	glasses = "BlueSun";
	speaker = "Male07EN";
	pitch = 1.05;
 	};
};

class CfgSounds
{
class sniper
{
	name = "sniper";
	sound[] = {\sound\sniper.ogg, db + 0, 1.0};
	titles[] = {};
};
};

The error returns is as followed...

20    E     Missing } before end of file
584    E     Missing } before end of file

See the coloured and bold { in the code.

This is not an issue at all and description.ext appears to be working fine with no errors at all, however it will confuse people who are new to scripting the description.ext.

:D

---------- Post added at 10:54 PM ---------- Previous post was at 09:33 PM ----------

Oh and one more thing...

When i have a unit on the map lets say i name him "ld1" it saves to mission.sqm. So i start adding all files to a new project in squint. Cool all good. Then you create a new script... i dunno summin like a dialog script or even a mission script.

The you have a code such as this...

ld1 groupChat "Hello Young, whats up lad?";

error returned in squint is..

Unknown variable ld1

Again this is not a major problem as i know ld1 is not a variable, it is the unit's name and i know that i can filter that out, would this be an issue? Or would the best choice be to filter it out as well as other errors that appears that we know is actually working?

Share this post


Link to post
Share on other sites

The error is that you have

name = Corporal Jagger";

instead of

name = "Corporal Jagger";

The colour coding is a bit of a giveaway here even if the error message isn't as descriptive as it might be -you might notice that everything after 'Corporal Jagger' is coloured in the default colour! Still, the error messages should be better here really and I'll look at trying to improve them.

*Edit* After adding the missing quote mark you then get the spurious error "Unexpected input 'sniper' in array element" for this line...

sound[] = {\sound\sniper.ogg, db + 0, 1.0};

I'm going to have to rethink my approach on how unquoted strings in cpp files are handled.... :-(

Oh and one more thing...

When i have a unit on the map lets say i name him "ld1" it saves to mission.sqm. So i start adding all files to a new project in squint. Cool all good. Then you create a new script... i dunno summin like a dialog script or even a mission script.

Squint should recognise named units in mission.sqm as global variables but it's possible I've broken something in the latest cpp modifications. If you can post a link to the mission.sqm in question I can check out why it's not working.

Edited by sbsmac

Share this post


Link to post
Share on other sites

Ah i hadnt notice that error :O i guess it was kinda hard to see with the theme i created myself. Thanks for that though lol :P That could explain why the names wouldnt appear on sideChat in game.

So for that I created a few themes i guess it's user preference... some people wont like these and some will. I personally am using the first one, thats what made me see the error clearly.

Wow you do have a lot to think about here, tough tough tough... good luck though.

Dul-egance (quit a dull elegant theme, i think it works)

http://www.mediafire.com/?jbbmpay87aq04vl

Dul-egance.jpg

Birds Of Beauty (reminds me of colours from birds. Theres a website that had a theme like this for Coda (mac))

http://www.mediafire.com/?2oo9pm6b77ju4c2

birdsofbeauty.jpg

BlackGlow (just a simple black background theme with bright colours)

http://www.mediafire.com/?dx75lz1g9m63ahd

blackglow.jpg

Painted Leaf (Gives the impression of bright paint on a leaf)

http://www.mediafire.com/?qnc7zvnsqz8mxf9

paintedleaf.jpg

---------- Post added at 12:15 AM ---------- Previous post was at 12:04 AM ----------

sent u pm sbsmac :D

Share this post


Link to post
Share on other sites

Thanks for the colour-schemes - uploaded to the main squint page :-) Also have the mission and know what the problem is - will be working on this over the weekend.

Share this post


Link to post
Share on other sites

V111 update

I've been working on improving the file-management for projects

* CTRL-N can now be used to create a new file within the project

* Projects are now automatically saved when you exit squint and then reloaded when you restart. If you dislike this behaviour you can disable it from the Settings/Editor/Misc dialog

* Save-as has now been re-enabled.

* Squint now has a concept of a 'project root directory'. New files are created in this directory by default and it can also be passed as information to custom commands. The root directory is set automatically when you add files or directories to a project or can be manually edited using the Settings/Project dialog.

* $PATH and $FILE are available to custom commands. $PATH evaluates to the root directory for the project and $FILE evaluates to the full path of the currently visible file.

Share this post


Link to post
Share on other sites
* Projects are now automatically saved when you exit squint and then reloaded when you restart. If you dislike this behaviour you can disable it from the Settings/Editor/Misc dialog

Is this strictly for projects, or all even one file saved like this?

What I mean is, if I start Squint, drag a single sqf there, fool around a bit and then for whatever reason I have to exit quickly... is the results saved, is the file modified by default or does it only save projects. If even one file is saved, then it definitely needs to other way around; if you like this feature, turn it ON from Settings/Editor/Misc dialog.

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  

×