Posted 8 years ago by KC
Version: 4.0.0287
Avatar
How can I get intelliprompt (and quickinfo) for a static (shared) method within a class object without fully qualifying the name of the method?

I.e.

I have a class called UserFunctions that contains several shared methods.

In code... if you type UserFunctions. (dot) you receive the methods listed in the intelliprompt window. If I select a function resulting with UserFunctions.Command1 then I get quickinfo and intelliprompt info if I then type the "(".

But, if I just type Command1 in code I do not get intelliptompt nor quickinfo for Command1. But, it is valid syntax because I have the Import for UserFunctions class already added to the code header.

Is there a way to have the DotNetAddon not require the class name and display intelliprompt and quickinfo for the shared method in this scenario?

Comments (12)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi, automated IntelliPrompt should be working fine for methods without needing the fully qualify the types. If you think there is a problem, please try and repro it in one of our samples and then give us a minimal code snippet to paste in there to show the issue.

If you can't repro it there then it may be some issue with your configuration. Be sure to read the "Key Steps for Getting Started" section in the documentation on the add-on. If you miss any of those, IntelliPrompt may not work correctly.

If that doesn't help, then make a new simple sample project that shows the issue and email it to us. Please don't include any .exe files in the ZIP and rename the .zip file extension so it doesn't get spam blocked.


Actipro Software Support

Posted 8 years ago by KC
Avatar
I'll see what I can do... But, I believe I have followed the steps in the "Getting Started" and QuickStarts. If my configuration was wrong I wouldn't expect to be getting intelliprompt info for everything else except those members...??
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you have a configuration problem or are missing some assembly references, IntelliPrompt could be incorrect, even if it is showing up elsewhere. But if it is set up properly, everything should be working fine.

Creating a new project to try and reproduce the issue will help narrow it down.


Actipro Software Support

Posted 8 years ago by KC
Avatar
I just sent an email with an attached project duplicating the problem I am having.
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the sample. You have a static class there with a static method on it. Those are never accessible the way you were trying to do. For something like that you always needs to put the type name in front of the method name. Try it in Visual Studio, you'll see the same thing.

I think what you were intending to make is a VB module. If you make your class a Module instead, then calling the method with its name only is valid code. Our automated IntelliPrompt partly works with module members. I know we still need some work with those though. But standard modules are the concept you're trying to achieve.


Actipro Software Support

Posted 8 years ago by KC
Avatar
Yes... I said it was a static (shared) method in my first post.

Whether it is a Module or a static method within a Class it is accessible (with the proper Using (or Imports) statements) the same way. If you do that then in Visual Studio it does show the intellisense without fully qualifying the method.

There are reasons to use a Class vs. a Module... in our case it has to do with our code generation engine and the way secure certain methods.
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I'm pretty sure VB doesn't work that way. I just verified it in VS 2010 by referencing your .dll, adding the import, and if it's a shared method in a class it will not show up in Intellisense in VS. A module's method will work like you want.

If you are seeing it working in VS, then please post how. But I'm not seeing it and I'm comparing a module and class variation from in the same namespace/assembly.


Actipro Software Support

Posted 8 years ago by KC
Avatar
You can try it in the project I sent...

Add Import Test.DemoFunctions at top...

Test.DemoFunctions.TestIntelliPrompt("s", 1)

TestIntelliPrompt("s", 1)

Both have intellisnes in VS2010.
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Aha, that's the difference. I didn't realize VB could do imports on a type to include its shared methods. We're C# people here and that isn't possible in C#, which is why I was getting thrown off.

This isn't supported in our add-on at this time. We'll write down a note to investigate adding it. We're currently building our next-generation platform of the add-on over in the WPF/Silverlight versions and are right at the point in development where we need to start handling things like this so this subtlety will be good to know.


Actipro Software Support

Posted 8 years ago by KC
Avatar
Good for you... not for me.
Posted 2 years ago by Wang Jian
Avatar

Hi,

Will this problem be fixed in the next release for winform?I still find this problem in the latest build(2016.1 build 0330).

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

We unfortunately don't have access to his original sample to check, but I believe that we did add this to our newer improved WPF SyntaxEditor add-on codebase.  It probably isn't in the WinForms version though.  We hope to possibly backport the newer codebase to WinForms in the future so all the platforms share the better codebase.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.