Jump to content
Sign in to follow this  
sbsmac

Squint - the sqf editor and error-checker

Recommended Posts

Sorry but I have no plans to change this since it is hugely more convenient for me to know that all users are on the latest version. If you want to really paranoid you've probably failed at the first hurdle by installing an app from some guy you only know from some dodgy gaming forum ! :-P (J/k -squint does not contain any malware/viruses/spyware/rootkits or anything else!)

And what if it autoupdates a hacked version? No, I'm gonna stick to my paranoia and not allow it access. I just can't do it - update on demand ftw :D No worries though, I'll keep it updated.

Share this post


Link to post
Share on other sites

I don't claim to be a security expert but since the manifest files are signed, it is not practical to 'spoof' an update with a hacked version. Your biggest risk is that I suffer some kind of mental breakdown in the future and issue a new update which does "bad things" . (Ironically this is far more likely to happen if I get stressed that people are reporting bugs against obsolete versions :-P ) In fact, in that regard, clickonce is more secure than the kinds of updates you get from most other places (including BIS - I'd suggest that anyone who really had it in for the arma community would simply spoof the beta download site rather that worrying about my little project!)

But don't just take my word for it, here's an official msdn blog saying much the same thing...

WRT to the spoofing scenario the gentlemen speaks to on your blog, the spoofer would need to have control of not only the server the application came from, but the keys with which it was orignally signed (all clickonce apps are signed with strong names for exactly this reason). You can't insert yourself in the middle and cause an application to update when it shouldn't. Security has definitely been a major priority with this technology.

http://blogs.msdn.com/b/tims/archive/2004/05/22/139526.aspx

All that said, I'll probably take a look at making the autoupdate a little more configurable in future - it'll never stop nagging you but you may be able to postpone the actual update for a while. :)

Share this post


Link to post
Share on other sites

earlier you mentioned it supports hpp files. I dont see a way to select one.

I see sqf

pbo, and config files and that is it.

Share this post


Link to post
Share on other sites
That doesn't look like the squint setup utility to me. The fact that the 'Cancel' button is labelled 'Chancel' looks very odd. Are you sure you're setup.exe hasn't been tampered with?

I`ve downloaded setup.exe from devheaven by the link in the first post. Sorry for mistake in the word. It was replaced by me. There was the same word but in russian. Do you need version with russian word?

Share this post


Link to post
Share on other sites

#define __Push(avar,theval) avar set [count avar, theval];

Underlining "Other" can make macro's harder to read. Most people, like me, probably use a specific number of underscore before and it is not a big problem. However, just want to bring this to your attention.

#define __Push(avar,theval) avar set [count avar, theval];

---------- Post added at 17:10 ---------- Previous post was at 17:04 ----------

Another issue with the auto-complete:

I have to locals in same scope: _targets and _targetZone.

It only outputs the top one unless I make it deduce down to only one. What I mean is as long as I have multiple possibles the top one is chosen no matter which one I select using the arrowkeys.

Writing _tar gives me (in the auto complete box):

_targets

_targetZone

Upon select _targetZone and pressing enter _targets get written instead.

And upon using autocompletion the Enter keypress is not intercepted.

Share this post


Link to post
Share on other sites

@gunterland.

The hpp filter is missing from the file/add to project menu. I'll add it but for now you can easily add hpp files by dragging them from the desktop and dropping them into the file-list. (You can also drag entire folders or pbos).

@Lion - sorry, I'm at a loss. Despite a fair amount of googling I'm unable to find anyone who has reported a similar problem :-(

@MuzzleFlash. The underlining actually represents 'folded' text. (The FAQ explains a bit more about this.) Looks like making this a bit more configurable would be a good option in the future though.

---------- Post added at 04:16 PM ---------- Previous post was at 04:13 PM ----------

Grrr - must have broken the normal auto-completion whilst hurrying to get the tab-completion working last night. Will fix later, in the middle of a major new feature atm.

Share this post


Link to post
Share on other sites

Ahh folded text. Now it makes sense. Also clears up my confusion to why other, "other" text like numbers weren't underlined. I have no isues with it now that I know why.

Question:

if (isNil "_ammobox") exitWith {};

Here "_ammobox" does not get same colour as string, however it get's same color as local variable. Intended?

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

Yep, because the analyser recognises that quoted strings after 'isNil', 'private' or 'for' represent the names of variables :) Amongst other things this allows squint to figure out that you have referenced the _ammobox variable in that statement even though you might not have used it elsewhere.

Share this post


Link to post
Share on other sites

Cool. I'm trying to convert to squint for my project editing. However, it did not import my (de)briefing.sqf file :S.

Share this post


Link to post
Share on other sites

Can you give more details or link to the file ?

Share this post


Link to post
Share on other sites

Oh.. I'm sorry I wrote that completely wrong. :o

It is more for the editor aspect of Squint. It is the briefing.html file, it does not get loaded even for editing. Don't know if "non-analysable" can even be made to be opened in squint?

Share this post


Link to post
Share on other sites

Just fixed (I hope) the auto-complete problem (forgot to comment out some debug code).

The 'major new feature' isn't quite finished yet but I've made a release anyway....

The following file extensions are now supported (through drag and drop):

*.sqf;*.h;*.ext;*.sqm;*.cpp;*.hpp;*.rvmat;*.bin;*.cfg;*.pbl"

If you drag a binarised file into squint, it will automatically show you the contents as text so you can edit them.

If you drag a pbo fle into squint, it will open all files with the pbo that match these file extensions. If any of those files are binarised, they will be unbinarised and presented as text.

To give an idea, here's what you see if you drag wheeled3.pbo into squint...

unbin.PNG

Note the rvmat files inside the pbo have been unbinned so you can view (and edit) them as text.

You can't yet save binarised files I'm afraid- was hoping to get it working today but there are a few wrinkles in the interaction with the grammar analysis. That should be working soon. In the meantime, since I'm not an addon expert by any stretch of the imagination, please feel free to let me know if you think the unbinning/cpp-analysis is any more broken than has already been reported.

Share this post


Link to post
Share on other sites

What's the best way of getting Squint to look over the contents of a file I have on the clipboard?

Share this post


Link to post
Share on other sites

Just CTRL-V it into the **scratch** window?

Share this post


Link to post
Share on other sites

I think it would be great if you at least add an "default" button to the "Fonts and Colors" settings. So when I F**** up I can revert it...

:j:

And if you might add line numbers, it would be easier for me to find on which line I have made my errors. because I do make a lot of errors...

Also, some times I just want to start fresh. A "close project" would be nice.

From ArmA Edit I'm used to tabs. Is that something your considering?

Otherwise this is a great tool!

Share this post


Link to post
Share on other sites

at Li0n:

free up some space on your harddrive! The installation comes with .NET redistribution so it needs alot of space.

Share this post


Link to post
Share on other sites
it does not matter, because charter ";" here. It saparate commands in line.

If it "didn't matter" then:

A. there would be no tab and no enter on my keyboard.

AND

B. I wouldn't have mentioned it.

We don't go through the trouble of using tab and multiple lines of code to have it jammed up on a single line later on by an automated process, or at least me and the mouse in my pocket don't. ;)

And yea the false postives cause problems for those that are unsure.

Anyway, one of the biggest issues I noticed was it trying to use too many privates in fact breaking longer script files because the varible was unable to pass to the next funtion. I think I said that right. I know, I know, I read what you said, however I thought I was baby sitting it, apparently it out smarted itself and me, but of course I had backups, just thought I would ask if it could be made smarter in those regards.

Edited by callihn

Share this post


Link to post
Share on other sites
I think it would be great if you at least add an "default" button to the "Fonts and Colors" settings. So when I F**** up I can revert it...

:j:

And if you might add line numbers, it would be easier for me to find on which line I have made my errors. because I do make a lot of errors...

Also, some times I just want to start fresh. A "close project" would be nice.

From ArmA Edit I'm used to tabs. Is that something your considering?

Otherwise this is a great tool!

All great points, especially the line numbers bit.

Share this post


Link to post
Share on other sites

Yes good suggestions and the multiple tabs for files is something I've been considering.

OTOH there's no effective difference between multiple tabs and the current system except that

1) you would click on the tab rather than the file in the file-list (might make selection of 'interesting' files a bit quicker).

2) The cursor and scroll position would be remembered for files (though I could add that to the current design)

Or am I missing something fundamental ?

Line numbers... yes although for various technical reasons, reconsituting line-numbers after the text has been through the preprocessor is a bit of pain. In the meantime are you aware that highlighing an error in the errror-list (or pressing ALT-UP or ALT-DOWN in the code-window) or pressing these buttons...

NextError.png

PrevError.png

will highlight the (approximate) position of the error in the code-window ? Often this highlighting is even more accurate than giving a line-number.

There is a full list of keyboard shortcuts, menu options, toolbar icons etc at https://sites.google.com/site/macsarmatools/squint/command-reference

"Close project" as you describe it is already implemented as "new project" which is this icon

NewProject.png

It clears the file-list (after warning you whether you have unsaved work) and lets you 'start again'.

@callihn

I think what wass meant was that syntactically the indentation is irrelevant. Of course it would be nice if squint was smart enough to use the 'right' indentation but rather than taking the'glass half-empty' view you might want to consider the large amount of typing this can save you when writing code from scratch. :)

As I've already said, the 'false-positives' are just warnings that you need to look more closely at the code is structured - unfortunately no tool can remove the requirement for human intelligence and experience. :)

Edited by sbsmac

Share this post


Link to post
Share on other sites
Of course it would be nice if squint was smart enough to use the 'right' indentation but rather than taking the'glass half-empty' view you might want to consider the large amount of typing this can save you when writing code from scratch. :)

Actually I was looking at it from 98% full.

Maybe it just needs a dumbass mode, what do you want me to say?

Hell I and others apparently didn't know when and when not to use the privates to begin with.

Edited by callihn

Share this post


Link to post
Share on other sites

:) Well, I'm genuinely interested in getting ideas about how the tool and output can be made easier to use and understand. Some of the error messages are a bit cryptic and though I've made an attempt an explaining some of them at https://sites.google.com/site/macsarmatools/squint/errors this could probably be improved.

If people want to suggest text to add to the documentation or errors/warnings that could be better explained I'd welcome it with open arms! Perhaps someone out there even fancies putting together some more tutorial presentations/videos? ;-)

Share this post


Link to post
Share on other sites

The thing about line numbers is that it helps me collaborate. If I'm looking at the file in Squint and I see it's picked up an error (or maybe a false positive) I can discuss it live in comms with my team and that's much easier if I can give them a line number.

When asking for line numbers, I hadn't considered the pre and post process thing. But thinking about it, post process errors and CTDs often quote a post process line number. Tracking that down in a file full of includes is a black art I've yet to master, but it's clear, to me at least there is potential benefit. I realise now, of course, the issues with having the application show post process line numbers.

Share this post


Link to post
Share on other sites

Understood about the line numbers - I think the best thing is if I think about some way to allow you to get hold of the line-numbers both in 'source' view (those will always be relative to the current file) but also it may be possible to figure out the line-number relative to beginning of the current included file when in preprocessed view.

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

But thinking about it, post process errors and CTDs often quote a post process line number. Tracking that down in a file full of includes is a black art I've yet to master

Actually the numbers you see are character indices into the post-processed output (whether you are in source or preprocessed view). The best way to track down CTF type errors for now is simply to switch to the preprocessed view and use next/prev error to highlight the one you are interested it. It's still a bit confusing knowing which incude file you are inside but at least you can see the code causing the problem.

Share this post


Link to post
Share on other sites

How about doing it like UltraEdit? Have a separate narrow window to the left of the source view that contains the line numbers. But unlike UltraEdit, don't number lines of preprocessor commands. No rush though, but maybe some day :)

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  

×