Sign in to follow this  
Followers 0
sbsmac

Squint - the sqf editor and error-checker

472 posts in this topic

Weird I must have scrolled down on line numbers cause pretty sure I saw the strange version. Well as long as it works when you scroll right :).

Share this post


Link to post
Share on other sites

Please catch Enter keypress so you can use autocomplete so stuff like:

AUTOCOMPLETE = AUTOCOMPLETE AUTOCOMPLETE (AUTOCOMPLETE AUTOCOMPLETE AUTOCOMPLETE);

Is more worth than it is trouble.

Share this post


Link to post
Share on other sites

Sorry, you're going to have to explain that one a bit more clearly. Here's how it works on my machine....

* I type d..i..s and the autocomplete box is showing me a bunch of options.

* I use the down arrow to scroll to the one I want, "disableUserInput"

* I press ENTER and the autocomplete box disappears and "dis" is replaced by "disableUserInput" in the codewindow.

The only thing I can think of you might be doing differently is to be using the mouse or scroll-wheel to select the desired word before pressing enter? In that case the enter is ineffective (since focus has moved away to the autocompletion control). Maybe this is what you would liked fixed ?

Share this post


Link to post
Share on other sites

I get another effect as well:

* I type d..i..s and the autocomplete box is showing me a bunch of options.

* I use the down arrow to scroll to the one I want, "disableUserInput"

* I press ENTER and the autocomplete box disappears and "dis" is replaced by "disableUserInput" in the codewindow.

* A newline is created immediately after the autocompletion

Maybe you only been testin' on fresh files? In that case you created a bunch of newlines at the end then?

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

Want only to say: Looks really great!

Didn't have the time to test it full, but really a nice work!

Will use it in the next time, and I think it will save me a lot of time!

THANKS for this editor!

Share this post


Link to post
Share on other sites

Glad you like it guys :)

1.0.0.87 - hopefully this fixes what you were talking about MuzzleFlash ? For bonus points you can now double-click in the autocomplete box to select.

*Bug #13220: mousewheel not working in code-window

*Bug #13221: autocomplete now works with double-click in list or enter after mouswheel/click

*Bug #13222: autocomplete inserted extra newline

Maybe you only been testin' on fresh files? In that case you created a bunch of newlines at the end then?

<cough> I only write this stuff- please don't ask me to test it as well ;)

Share this post


Link to post
Share on other sites

Hmm, I think JamesF1 referred to it as 'constructive criticism' !

Talking of which I managed to miss this post earlier...

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.

That's a very interesting offer and one that I may well take up in future. Right now I'm at that stage in a project's life where it's a tangled mess of 'temporary' hacks that only makes sense in my head - very soon I will have to take a step back and knock it back into something that looks more like real software. If you're a net programmer though there are the beginnings of some documentation here. Clearly that's only a very small subset of what goes into squint but it might be interesting to some people.

What I'd really like to outsource is some of the documentation/promotion. The two presentations I did were quite fun and a good break from coding for a couple of hours but I'm painfully conscious of how 'bare' the documentation is. How many people apart from muzzleflash even know that there is an autocomplete feature? And the lack of bug-reports/questions about preprocessed mode implies that a lot of people aren't aware of how useful this can be. Etc etc. Any serious offers to help out here would be most appreciated, even if it's just another couple of paragraphs I can paste into the webpage... :)

Share this post


Link to post
Share on other sites

sbsmac this isn't priority bug however it is annoying enough you may want to put it pretty high on the list :). (Sorry still no dev-heaven user):

When writing a "non-closed" string and multiple lines follow (in my problem case about 200) then squint becomes very sluggish until the string is closed. You can avoid part of this sluggishness by writing the close string immediately, however even the closing character takes 5s before analysing (I think) is done. Hurts computer when writing format strings.

If this lag is due to analysing then perhaps limiting string parsing to the line being written or something.

Share this post


Link to post
Share on other sites

Thanks will take a look at why this is so slow. Off the top of my head I suspect that squint is matching your opening quote against the first following one it finds in the file (strings in sqf can span multiple lines annoyingly). Obviously having done an unbalanced match it will start treating the contents of that string as commands and so on. The end result is that it is probably generating hundreds of errrors and copying these into the error window is what I think is really slowing things down (all other analysis and rendering is done by a bacground thread so shouldn't impact editing) .Limiting the error count to a sensible number is probably the best fix for this.

Share this post


Link to post
Share on other sites
That's a very interesting offer and one that I may well take up in future. Right now I'm at that stage in a project's life where it's a tangled mess of 'temporary' hacks that only makes sense in my head - very soon I will have to take a step back and knock it back into something that looks more like real software.

You should see most of the code I've deployed to clients :p I don't actually have many pieces of code that I've ever sat back and gone: "I'm 100% happy with that." Part of being an overly-self-critical, I guess :rolleyes:

If you're a net programmer though there are the beginnings of some documentation here. Clearly that's only a very small subset of what goes into squint but it might be interesting to some people.

Will have a look through when I get some time. I've done a decent amount of serious development in C#, but I'm far from a .NET expert... I'm one of those guys who can write genuinely useful applications in a variety of languages (from x86 ASM, through to Prolog, and back again)... but I simply don't get enough day-to-day 'practice' in any one language to achieve 'mastery'. Jack of all trades, master of none ;)

How many people apart from muzzleflash even know that there is an autocomplete feature?

I'd say that one would be fairly obvious as soon as you start typing :p

Share this post


Link to post
Share on other sites

A while back ago a made a program (in Net 3.5) that could send code/script back and forth from ArmA 1. It also monitored the Arma.rpt file in real-time for any errors that the script generated so you could easily identify what went wrong. What it also did was monitored variables and when they changed you could be notified aswell as get a history of previous values the variable held. I dont think it would be a huge ordeal to port the program to Arma 2. I suggest you check it out as the functionality of this program would complement yours (merge maybe?).

LINK

Regards

Ragnar_Darude

Share this post


Link to post
Share on other sites

Ah, but autocomplete is off-by-default because it was an experimental feature so unless you've specifically turned it on you won't see it. :)

Just for a bit of light relief from the coding I felt compelled to start a blog about squint development. I know 99% of them are read by less than 1.5 people but what the hell, it gives me an outlet for some of the frustrations....

Crosseyed and Painless

I'll even take requests if people are interested in particular aspects of the tool ;)

Share this post


Link to post
Share on other sites

What is "Enable keyword protection"?

BTW, it turnded out on my script examples the other two were OK, it just didn't like the _moved set to anything > 0, seems that makes things constantly respawn, which is wierd considering they really have not moved.

Thanks

Edited by callihn

Share this post


Link to post
Share on other sites
What is "Enable keyword protection"?

A misquote of "enable keyword prediction" :)

If you turn it on, squint will pop up a little dialog box as you start to type things that look like keywords.

For example if you turn it on (make sure the menu item is checked) and type 'p', you'll see a box appear under your typing showing all the keywords starting with 'p' type 'l' next and the list is narrowed to all those that start with 'pl'. Use the up and down arrows if you want to go and manually select one of the ones you see. Press ENTER to copy the selected keyword into the code window. Use TAB to do unix-style word completion.

So for example the sequence d..i..s..a..TAB..DOWN_ARROW..ENTER gets you "disableConversation".

It also knows about local variables. Soon enough I'll teach it about global variables and function names.

---------- Post added at 12:06 AM ---------- Previous post was Yesterday at 11:42 PM ----------

sbsmac this isn't priority bug however it is annoying enough you may want to put it pretty high on the list . (Sorry still no dev-heaven user):

When writing a "non-closed" string and multiple lines follow (in my problem case about 200) then squint becomes very sluggish until the string is closed. You can avoid part of this sluggishness by writing the close string immediately, however even the closing character takes 5s before analysing (I think) is done. Hurts computer when writing format strings.

If this lag is due to analysing then perhaps limiting string parsing to the line being written or something.

I've limited the number of error reports shown to 10 as a workaround for now until I come up with a better solution.

Edited by sbsmac

Share this post


Link to post
Share on other sites

Interesting read on your blog.

I really feel more confident in my scripting in squint. When smart(er) indenting is implemented I will never use anything else for arma editing.

Will you add hotkeys for fixing bugs, duplicating a line and other stuff?

Share this post


Link to post
Share on other sites

TY :) CTRL-ALT-F to fix a bug (see https://sites.google.com/site/macsarmatools/squint/command-reference, 'keyboard shortcuts' column) for other useful keys.

Duplicate a line... I always just tend to use Home,shift-down-arrow, shift-delete,shift-insert,shift-insert which sounds a lot worse than it is to actually do ! Happy to add shortcuts for these kinds of things though if you have specific suggestions.

And the indenting is something I'm quite keen on myself having become addicted to auto-indent in emacs and ctrl-e-d in Visual Studio. There is already an auto-indent feature for cpp files but its a bit harder to make it work for sqf...

Share this post


Link to post
Share on other sites

The only suggestion I can think of at the moment is the duplicating line. CTRL+D? Of course this is just a personal preference.

First: I haven't giving it much thought. However, isn't the only thing determining basic indentation in sqf braces? You start at "indentation level" 0. When opening brace is encountered you go to level 1 on all following lines. And so on. When closing brace is found you go one level down on all next lines or something like that?

Share this post


Link to post
Share on other sites

Ohh, thanks Mac, doesn't look like a good day to script when I can't read any better than that, LOL!

BTW, I tried the reformat, I don't think it should be deleting things?

Edited by callihn
Not type too well either apparently.

Share this post


Link to post
Share on other sites
However, isn't the only thing determining basic indentation in sqf braces? You start at "indentation level" 0. When opening brace is encountered you go to level 1 on all following lines. And so on. When closing brace is found you go one level down on all next lines or something like that?
BTW, I tried the reformat, I don't think it should be deleting things?

Thanks - I was wondering what to write next! Indentation - lex or parse ?

Callihn (and others) the main point of that post is you should NOT try to use the CPP indenter/formatter on sqf files at the moment (really I should disable this in the menu),

Share this post


Link to post
Share on other sites
Thanks - I was wondering what to write next! Indentation - lex or parse ?

Callihn (and others) the main point of that post is you should NOT try to use the CPP indenter/formatter on sqf files at the moment (really I should disable this in the menu),

OIC, BTW can you make it do some kind of animation or something to let us know it's still working, that way we know when it's ready for more input.

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  
Followers 0