Posted 10 years ago by Alex Baruta
Version: 14.1.0601
Avatar

Hi,

Is there a way to share the same VBProjectAssembly instance across multiple Actipro Syntax Editors ?

My scenario is the following:

- I use a global VBProjectAssembly that is registered by a VBSyntaxLanguage that is assigned to the Document

- Then I open the Editor, and Intellisense is showing me the expected available types

- I close the Editor and I add a new import, for example the System.IO namespace

- I reopen the Editor (a new instance) and the Intellisense is not showing the types from the System.IO. But if I type "Directory." I get the available static methods !

So it seems that Intellisense is not refreshed after I add an Import Namespace.

I tested and it works as expected if I use a new VBProjectAssembly instance each time, but I am really interested in using a Global VBProjectAssembly for all my Editors instances.

Thank you,

Alex.

Comments (3)

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

Hi Alex,

When you create a new VBSyntaxLanguage, you normally are setting a VBProjectAssembly to it.  You have two choices:

1) You could create a single instance of the VBProjectAssembly.  Then store it statically in your app and apply that to every VBSyntaxLanguage you create.

or

2) You could create a single instance of a VBSyntaxLanguage and store it statically in your app.  Make a single instance of a VBProjectAssembly and apply that to the language.  Then whenever you create an editor instance, use that same singleton language instance.  Languages are intended to be reused across multiple editors/documents.

As for types not showing, that all depends on which assemblies you have referenced from your VBProjectAssembly and which namespaces have been imported.  For instance, if you forgot to reference things like MsCorLib, types such as System.Int32 might not show up in IntelliPrompt, even if you import the System namespace.  Think of project assemblies like a Visual Studio project.  IntelliPrompt will show whatever types are available based on the referenced assemblies (set on the project assembly) and imported namespaces (set in the document text).


Actipro Software Support

Posted 10 years ago by Alex Baruta
Avatar

Hi,

Thank you for the reply.

But the scenario you propose is exactly the one I use and described above, which unfortunately does not work as expected.

About adding the correct references, I can assure you that I reference MsCorLib right from the begining.

Please try to reproduce the issue by following the scenario I wrote.

The product version I use is 12.2.571.0

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

Hi Alex,

We can take a look but please put together a new simple sample project that just shows this issue and email it to our support address.  Reference this thread, include instructions for the steps to repro it, and be sure to rename the .zip file extension so it doesn't get spam blocked.  Then we can debug your scenario and see what is happening.  Thanks!


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.