ParameterIndex not sensitive to strings

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Kasper
Version: 4.0.0274
Avatar
Hi,

I have implemented parameter info for PHP using the basic way of setting the ParameterDelimiterCharacter to "," and so on. When the IntelliPromptParameterInfoParameterIndexChanged event is fired, I update my parameter info. However, SyntaxEditor doesn't seem to care whether or not the comma is within a string or not, which means that something like myFunction("hello," would make it shift to parameter number two. I can see that this works better in the SDI demo app, with the .NET language add-on. How should I change my current implementation to be context-sensitive, like the .NET add-on?

Comments (5)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It scans tokens and in languages like the .NET Languages Add-on ones, each string is a single token. That is how they are skipped. You'd have to do something similar.

If you are unable to do that, then you can choose not to use the built-in functionality and write similar code yourself to scan which parameter you are in. All it does is scan the surrounding text when SelectionChanged occurs and updates the ParameterIndex property.


Actipro Software Support

Posted 11 years ago by Kasper
Avatar
I just tried doing this manually, but it seems like the ParameterIndex is reset by SyntaxEditor on each keystroke. So when I set the ParameterIndex, the box flickers on each keystroke, because I have to set the ParameterIndex each time. How do I avoid that?

I already tried setting CloseDelimiterCharacter and ParameterDelimiterCharacter to '0', as described in the documentation, but that doesn't seem to fix this issue.

Update: Okay, a "null character" is actually '\0' - took me a bit more Googling to figure that one out :). You might want to add that to the documentation, it would have been a great help to me and probably others as well :)

[Modified at 04/16/2008 06:17 AM]
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Correct setting it to '\0' will prevent the ParameterIndex updates. That info is in the documenation for ParameterDelimiterCharacter, but I'll add the explicit '\0' example to it. Thanks.


Actipro Software Support

Posted 11 years ago by Kasper
Avatar
Yeah, I did find it in the documentation (which is rather good, it has helped me a bunch of times), but stating that a null character is a '\0' would make it perfect :)

In the mean time, I seem to have it working with manually updating the ParameterIndex. It's great! :)
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Great, glad to hear it!


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.