MantisBT - mSLDev
View Issue Details
0000082mSLDevAutoCompletepublic2013-03-23 12:002013-04-13 08:06
Win7 64-bitWindows 7(6.1) 
0000082: $nick()
I typed '$nick(', msldev autocompletes with '$nick()' and then display in the error list: Ident $nick: too few parameters.
Type '$nick('
Clearly, the $nick() function isn't available for calltip.
Now, the autocompletion is inconsistent:

-You type: '$bytes(' manually
>it auto adds the ), and put the cursor in the middle, this is actually the case and is fine.

-You type: '$by' and autocomplete $bytes
> it just write $bytes for you, without adding the ( and the ) and putting the cursor in the middle, no calltip either, this is wrong imo.

now, getting '$bytes()' to be displayed and moving the cursor somewhere else doesn't bring an error $bytes: too few parameter, why is so special about $nick?

Anyway this is several issues related together so i made only one post.
Since i'm here, the calltip should disappear automatically in some cases but doesn't, i'll make a seperate report.
No tags attached.
Issue History
2013-03-23 12:00WimsNew Issue
2013-03-23 12:41administratorNote Added: 0000037
2013-03-23 12:43administratorNote Edited: 0000037bug_revision_view_page.php?bugnote_id=37#r15
2013-03-23 13:34WimsNote Added: 0000040
2013-04-13 08:06administratorNote Added: 0000084
2013-04-13 08:06administratorStatusnew => closed
2013-04-13 08:06administratorAssigned To => administrator
2013-04-13 08:06administratorResolutionopen => fixed
2013-04-13 08:06administratorFixed in Version =>

2013-03-23 12:41   
(edited on: 2013-03-23 12:43)
The auto-complete is consistent - nothing to do with the (->) completion.

When you type ( at the end of an identifier, mSLDev will insert a ). That's the only time.

Nothing is special about $nick per se. $bytes() can take 1 argument - no errors. $nick() cannot take only 1 argument, it's an error - that's why mSLDev is issuing an error.

2013-03-23 13:34   
Well, i'm saying when you autocomplete an identifier, it should get you to the calltip, with () already there, not just complete the name. That would be better, you're not going to complete it not to go ahead with it.

Now, the problem about reporting error is that it's not correct to yield at the user if you, msldev, actually completed the $identifier syntax (adding the ')') for the user. I suggest not reporting the error if the cursor is inside the $identifier(), that way you'll only report the error when the user keep going with the code, and is outsite that identifier, if he jumps back into the identifiers causing an error, you obviously keep the error, but if he fixes it and reintroduce a new error, you still wait for the cursor to be elsewhere.
2013-04-13 08:06   
Auto-complete now adds the () when appropriate. As for the errors showing, this behavior will remain for the time being. (All settings can be disabled via the option window).