Jump to content
Sign in to follow this  
sbsmac

Squint - the sqf editor and error-checker

Recommended Posts

Second, and this is more important, once you startup the color picker, the currently selected/defined color needs to be repicked, which currently doesn't happen.. so it's currently a bit of a hassle to find the "sweet spot" of a color, since you can't slightly adjust the last picked one... should be no big deal to pass the initial color to the picker I guess

Good point and now done.

Also added some of the new scripting commands in the latest release.

Thanks for the extra compositions - I can see you have a thing about pink which I shall comment on no further ! They'll be on the website shortly :)

The problem is that the operator-color doesn't affect syntax (parenthesis, semicolons and stuff) and numbers... so these characters stay black, which obviously doesn't work with a dark background.

Actually these are under the 'default' colour. The problem is that I forgot to wire that one up (I knew I was bound to miss one) when I changed the rtf-rendering mechanism -now fixed so you should be able to change this.

@Katrician

Glad you like it :)

You raise a valid point with sentenceId I got this error while checking BIS official mission, so when Squint highlight this type of error, what would be the solution to fix it? If I understand correctly Squint analyses all the files and find code not-related in any of the files.

Well obviously with the BIS missions you might as well leave them alone since they are working 'well enough'. (In the future I will implement a mechanism to allow you to disable some of squints error checks so you can ignore the ones you are confident are 'safe'.)

If you were writing your own script that was generating an error similar to the "_sentenceID" one you talk about, I would suggest that you just change the way you call the scripts. Eg, instead of writing

//sidechat.sqf - a script to talk to the player

player sidechat format ["hello %1",_aVariable] ;

and then using

_aVariable="World";

execVM("sidechat.sqf");

I would suggest you write sidechat.sqf as function...

doSidechat={

player sidechat format["hello %1",_this select 0];

};

then call it with the string you want...

call compile preprocessfile "sidechat.sqf"; //compile all the functions inside the library file (you only need to do this once in init.sqf

["world"] call doSidechat;

Share this post


Link to post
Share on other sites
I can see you have a thing about pink which I shall comment on no further

bwahahaha,

now I see it too :icon_ohmygod:

In my defense: on my primary monitor, the color does not look pink at all, just not that brighty whitey. But yeah, on the other one, I can clearly see what I did there.. :D

Last one is just for ruebe ;)

Ahhhh, that's great.

I like my colors red. :rolleyes2:

Btw. it would be nice, if we could drag'n'drop our files anywhere, especially to the main editors window too and not only to the overview window. I catch myself a few times trying to drop a file in the editor's window, simply because that was the only area I could access that moment (overview was behind some other application, squint beeing out of focus)..

Oh and.. I just got aware of a little coloring problem:

(checkAIFeature "AwareFormationSoft")

Here, "AwareFormationSoft" get's rendered in the "Default" color instead of the defined "String" color. I'm not quite sure why this happens. Funnily here:

"AwareFormationSoft" enableAIFeature true;

"AwareFormationSoft" gets colored correctly in the defined string color.

Maybe some function signature mixup or mistyped argument?

hmmm, also here:

onTeamSwitch { 
  private ["_leader"];
  //...
};

the "_leader" inside private does not get colored in the string color, but in the operators color instead. Funnily here:

onTeamSwitch { 
  private ["_leader", "_b"];
  _b = ["correctlyColoredAsString", "yeahMeToo"];
  //...
};

"_leader" and "_b" are still in the wrong color, but "correctlyColoredAsString", "yeahMeToo" are fine.

And while we're at it, here my latest color-scheme, featuring colored numbers but otherwise pretty minimal and inspired from my notepad2 color-scheme I like to use; uhm, let's call it "Chez Luigis":

<Codeview>
<FontName>
	Consolas
</FontName>
<FontSize>
	11
</FontSize>
<Background>
	White
</Background>
<Highlight>
	AliceBlue
</Highlight>
<Default>
	ff0a246a;Regular
</Default>
<Comment>
	Green;Regular
</Comment>
<LocalVar>
	Black;Regular
</LocalVar>
<GlobalVar>
	Black;Regular
</GlobalVar>
<Operator>
	Black;Regular
</Operator>
<String>
	Green;Regular
</String>
<DeffedOut>
	Orange;Strikeout
</DeffedOut>
<Macro>
	Orange;Regular
</Macro>
<Number>
	Red;Regular
</Number>
<Other>
	White
</Other>
<OtherFontName>
	Consolas
</OtherFontName>
<OtherFontSize>
	9.25
</OtherFontSize>
</Codeview>

Do you see how much fun numbers in color, especially in red, are?

:292:

Share this post


Link to post
Share on other sites
Btw. it would be nice, if we could drag'n'drop our files anywhere, especially to the main editors window too and not only to the overview window. I catch myself a few times trying to drop a file in the editor's window, simply because that was the only area I could access that moment (overview was behind some other application, squint beeing out of focus)..

Fair point - will add this. Actually kju already raised it as http://dev-heaven.net/issues/12861

Oh and.. I just got aware of a little coloring problem:

Hmm - couldn't reproduce your first string-colouring problem -seems to work fine for me. As you surmised in http://dev-heaven.net/issues/13367 though, it looks like squint is missing a couple of operator definitions (every time Ithink I have got them all BIS seem to add another couple!) so I'll add these.

Squint is smart enough to know that quoted strings inside private arrays (and isnil and for) are local variable names so you are seeing them being coloured in the 'local variable' colour.

And while we're at it, here my latest color-scheme

Lol - I can see I've created a monster. The red is ok but Orange for preprocessor directives ? :p

Here's my favourite scheme.... FisherPrice ;)

Share this post


Link to post
Share on other sites

Hey Mac can we get bracket pair matching and you might consider adding a default button on the code-window settings, I still think it would be nice to know when it is still working too, when loading large projects it becomes a guessing as to when it is finished checking all the files.

Share this post


Link to post
Share on other sites
Hey Mac can we get bracket pair matching and you might consider adding a default button on the code-window settings, I still think it would be nice to know when it is still working too, when loading large projects it becomes a guessing as to when it is finished checking all the files.

You can get bracket-matching by right-clicking anywhere in the code-window and selecting 'highlight bracketed area' - squint will 'search' out to the first set of enclosing brackets - '{' '(' or '['. Is this what you were after ?

you might consider adding a default button on the code-window settings

Yes, good suggestion but in the meantime there is a 'default' scheme available from the colour schemes page.

I still think it would be nice to know when it is still working too, when loading large projects it becomes a guessing as to when it is finished checking all the files.

Good idea. It won't actually do any harm if you want to start editing a file before squint is finished analysing the project but I'll think about some way to get it to indicate it is busy.

Share this post


Link to post
Share on other sites
Squint is smart enough to know that quoted strings inside private arrays (and isnil and for) are local variable names so you are seeing them being coloured in the 'local variable' colour.

hmm, while I understand that kind of reasoning, I still do not agree with this.. for technically these are not local variables, but only the declaration of local variables and as such these are strings.

But don't worry, I guess that's your design choice. :)

Lol - I can see I've created a monster.

...says the guy coding with fisher price colors on black background...

:pet12:

The red is ok but Orange for preprocessor directives ? :p

Yeah, that's right!

Friggin orange! :yay:

Maybe I should do one along these lines. That should suit you better, I guess.

Do you see that orange buttons? Beautiful, aren't they? :D

Share this post


Link to post
Share on other sites
Maybe I should do one along these lines. That should suit you better, I guess.

Do you see that orange buttons? Beautiful, aren't they?

Lol - I have to get one of those ! Wonder if it'll run Arma...

Share this post


Link to post
Share on other sites

Now Squint is only showing partial files stopping at 147 lines.

Also for a few updates now just opening a file makes it appear changed and prompts you to save on exit even when no changes were actually made.

Edited by callihn

Share this post


Link to post
Share on other sites

>Now Squint is only showing partial files stopping at 147 lines.

You'll need to help me out a bit more on that one since "it's working for me" ;)

>Also for a few updates now just opening a file makes it appear changed and prompts you to save on exit even when no changes were actually made.

Will double-check this.

Share this post


Link to post
Share on other sites

Mac-

Just got around to working with this, installing NET4 was the hangup. :) I'm seriously impressed - this is a huge asset!

I'll also apologize for not reading the entire thread before posting my only critique. :D I re-use alot of code and just rem out the old stuff until I'm finished. Bad part is, I'm almost never "finished" so they just sit there, but either get caught in the private statement, or show up as an undeclared variable.

Is there some way to have a tier system where bad stuff - like an undeclared variable - shows the file as red, but less important stuff - like an unused declared variable - only shows the file as yellow or something? Or the ability to mark certain errors as "ignore"?

Thanks for a great tool!

T

Share this post


Link to post
Share on other sites

Glad you like it. Funnily enough I'm just putting the finishing touches to a 'filter' system which allows you to mask out certain errors. It seems to work quite well - using it I can actually load the thousand-odd files from missions.pbo and reduce the amount of 'fluff' to the point where I can start to see genuine errors.

I'll be pushing out a new version that includes this ability shortly - just got to write a little documentation for it first :)

Share this post


Link to post
Share on other sites

2 things:

First - that is FANTASTIC response time!!! :D

Second - WTF? A coder who documents? What sort of alien intelligence are you!?!?!?111eleventyone

Share this post


Link to post
Share on other sites

Ha-ha - check out the subpages on the squint page. I've had very little feedback on the documentation (positive or negative) so kind of wondering whether it's really worth doing but hopefully some people read it.

Share this post


Link to post
Share on other sites

I'm a bit of a documentation hound, so I've already taken a look. No complaints really. Might be nice to have screenshots of the themes instead of the text. My imagination is good, but not THAT good. :)

I'm also digging a bunch of your other tools (no, not THAT one, although you are a handsome man). You now be bookmarked by me.

Oh... and... uh....

Working with pbos and binarised rap files

Squint can work directly on the files inside a pbo. It can also 'unrap' binarised files automatically, even those inside a pbo. When you modify a file inside a pbo and then save it, the file is written back into the pbo and the pbo itself is written back to disk.

That... uh.... IS KINDA A FREAKING BIG DEAL! Can't wait to try that.

Just an idea for a feature, but I'm not sure how realistic it is. I'm getting to a point where I have a core set of stuff, then stuff that branches off from it, but some of these are related. Like my mines - there are a couple other versions I'm doing specifically for mods with special requirements. Would possibly be helpful to have subprojects of projects that I can borrow across, then do subproject-specific name/variable changes.

Does that even make any sense?

Share this post


Link to post
Share on other sites
>Now Squint is only showing partial files stopping at 147 lines.

You'll need to help me out a bit more on that one since "it's working for me" ;)

>Also for a few updates now just opening a file makes it appear changed and prompts you to save on exit even when no changes were actually made.

Will double-check this.

I found what broke it and I'll show you via PM.

Share this post


Link to post
Share on other sites

Excellent - thanks :) Got your PM and I'll try and figure out why it's misbehaving.

---------- Post added at 08:37 PM ---------- Previous post was at 08:07 PM ----------

k - fix coming up shortly.

@TRexian - lol, finally my very own internet stalker ;)

>That... uh.... IS KINDA A FREAKING BIG DEAL! Can't wait to try that.

Ty - I think it's pretty neat as well although no-one else has commented on it. One slight restriction - for now you can't actually change binarised files. I just need to make a couple more tweaks to allow that.

Just an idea for a feature, but I'm not sure how realistic it is. I'm getting to a point where I have a core set of stuff, then stuff that branches off from it, but some of these are related. Like my mines - there are a couple other versions I'm doing specifically for mods with special requirements. Would possibly be helpful to have subprojects of projects that I can borrow across, then do subproject-specific name/variable changes.

I'm not entirely sure what you are getting at here (sounds like a good revision control system that handles branching would be useful to you). In terms of squint, there is nothing to stop you having one 'uber' project that consists of all your files and then a different project that just contains a subset. Does that help ?

Share this post


Link to post
Share on other sites

That does help. I need to become more familiar with your app before I really start offering any critique. (Probably should've done that before posting, too.) ;) The functionality I'm looking for may very well already be in there.

It would also help if I were actually organized....

Share this post


Link to post
Share on other sites

Don't let Sbsmac take a breath claim for new features 24/24 :D

By the way Sbsmac I'd like to edit scripts while in Squint, sadly there is no copy/paste feature like Notepad; I know Squint is primary for checking errors, but its colors are great for lines full of soldiers, ie "TK_Soldier_EP1" when you have twelve or more Notepad is confusing.

Secundo is Squint needing large ressources? because it takes some times to open then check a project.

Third not related to Squint, but related to "coding", too more often the mission I load in the editor get an error TK_Soldier no more here, in fact it adds a space eg " TK_Soldier...." instead of "Tk_Soldier...", I fix the error opening the mission SQM with Notepad, suppress the empty space, save, reload the mission in the editor, save it, and usually an similary errors or the same reappears?? any ideas to fix it for once and all?

Share this post


Link to post
Share on other sites
Don't let Sbsmac take a breath claim for new features 24/24

hehe- I like to be kept busy !

By the way Sbsmac I'd like to edit scripts while in Squint, sadly there is no copy/paste feature like Notepad;

Oh yes there is ! Have you tried CTRL-C or CTRL-V ? ;) I'm trying to make squint an editor just as much an error-checker so feedback here is very useful.

Secundo is Squint needing large ressources? because it takes some times to open then check a project.

It depends on the size of the project. I just fixed a bug which caused squint to be much slower opening large files than it needed to be. The fix for this will be in version 101. There is a certain amount of work squint needs to do when opening a project.. it needs to open all files, parse them, collate all the global variables, then check for errors before pre-rendering all the files in those pretty colours. I'm still tweaking this aspect so expect some more improvements here. I'm currently working with a project that has over one thousand files (missions.pbo from OA) and squint can handle that although it takes a couple of minutes to check everything.

Third not related to Squint, but related to "coding", too more often the mission I load in the editor get an error TK_Soldier no more here, in fact it adds a space eg " TK_Soldier...." instead of "Tk_Soldier...", I fix the error opening the mission SQM with Notepad, suppress the empty space, save, reload the mission in the editor, save it, and usually an similary errors or the same reappears?? any ideas to fix it for once and all?

I'm not sure I understand your explanation of what is happening - could you go through it again a bit differently ? The only thing I can guess at is that it might be something to do with line-endings but that's a bit of a long-shot.

---------- Post added at 09:35 PM ---------- Previous post was at 09:21 PM ----------

1.0.0.101 is out...

*Bug #13227: unclosed strings don't get correctly highlighted in string colour

*Bug #13367: missing signature for some commands (waypointAttachObject, enableAIFeature)

*Bug #13373: line-numbers coud lose sync when deleting text from the end of a file

*Bug #13387: It was possible for characters to get lost whilst typing quickly in large files

*Bug #13399: Squint now much faster (preprocessing phase used very inefficient string building)

*Bug #13402: precedence still needs a little tweaking

*Feature #13374: Add link to colour-schemes page from settings

Squint also contains a protoype filter system which I will document on the website shortly....

---------- Post added at 09:59 PM ---------- Previous post was at 09:35 PM ----------

Documentation on filters: https://sites.google.com/site/macsarmatools/squint/filters-and-the-dictionary

NOTE- this is an experimental feature I'm still playing with so will probably change. Feedback welcome from those who want to give it a try.

Share this post


Link to post
Share on other sites

Did some quick fiddling.

Very much like the filter arrangement. Encompasses everything I can think of for now.

In the documentation...

Embedded filters are more useful if you play to re-use files...

I think you meant "plan"? :)

Otherwise, well done, and so far, so good....

Edit:

It appears that if I want to make the '_smthng' declared but not used globally filtered, it doesn't use wildcard?

Edited by TRexian

Share this post


Link to post
Share on other sites

Ta - typo fixed.

It appears that if I want to make the '_smthng' declared but not used globally filtered, it doesn't use wildcard?

Right-click on the error and choose "filter out for all files in project".

Then go to the filters menu and choose "edit project filters"

Look for

//#squint filter '_smthng' declared but not used

at the end of the file and replace '_smthing' with '*'

If you have already done all that and not seeing the errors disappear in other files it's because I haven't yet wired things up so all the error-lists get rechecked after you've added a global filter (it's still a wip feature!). You can force this though by right-clicking in the file-list and choosing "Reload all files in project" (careful, this will discard any edits you haven't yet saved.)

Other 'gotchas' - adding filters doesn't mark the project as 'changed' so you can easily fall into the trap I keep making of spending 10 minutes setting up all my filters then losing them by loading a new project before saving the old one. Just hit 'save all' on a regular basis and you shouldn't go too far wrong.

Share this post


Link to post
Share on other sites
I'm trying to make squint an editor just as much an error-checker so feedback here is very useful.

In that case, I have one for you: text selection. Do something about it. At least on my xp box, selecting text in squint is a pain in the ass(!), because it snaps the selection to some obscure pattern.

:16_6_8:

Let's have an example:

private ["_tmp"];

If I try to select "_tmp", I fail everytime. Starting the selection at the first quote, I can select up to "_. The moment I try to select "_t it snaps the selection to ["_tmp (I don't want to select the friggin brackets!). And if I try to select from right to left, starting with the closing quote, the moment I select p" it snaps to tmp"];?! WTF?!

Due to this selection-auto-snap, I'm much too annoyed to use squint for any means of coding/editing - it is such a hassle.

So if you could look into this selection-snap behaviour and shut it the *peep* off, that would be really bananas.

:), ehhrm here, this one: :yay:

Share this post


Link to post
Share on other sites

Neener neener neener..... :D

Was kinda hoping you didn't check back on this thread.... ;)

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  

×