Question

HTML and VB.NET intelliprompt simultaneously?

Posted 5 years ago by Avatar Alessandro Sorcinelli
Hello,
I'm evaluating your product.
I have seen all the examples, but I have a question: is it possible to enable the intelliprompt for the HTML language e VB.NET simultaneously?

I see that I can use DotNetProjectResolver for the .NET assembly and the XmlSchemaResolver for the HTML, but I can't enable these two objects in the same editor.

I would like to obtain an editor like Visual Studio, with intellisense for the HTML fragments and for the VB.NET fragments too.

Thanks in advance.
Alessandro

Comments (8)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Alessandro,

Sorry but that isn't yet supported with our add-ons. It is a goal we are working towards as we develop our framework going forward though.

Actipro Software Support
Posted 5 years ago by Alessandro Sorcinelli
Ok.
Now I'm trying to obtain a simple solution.
I would like to have a sample application like the HTML sample that comes with the trial:

- Code highlighting for HTML, CSS, Script Block
- Base intellisense for HTML

In my sample I use the file ActiproSoftware.HTML.xml that I have modified for running in my assembly. The code highliting works well, but I can't obtain the intellisense.

This is my init code:

SemanticParserService.Start()

editor.Document.LoadLanguageFromXml(Application.StartupPath + "\files\ActiproSoftware.HTML.xml", 0)

editor.Document.AutoCaseCorrectEnabled = False
editor.Document.SemanticParsingEnabled = True
editor.Document.LexicalParsingEnabled = True


After these lines I load sample HTML files.
Where is the problem?

Thanks in advanced.
Alessandro
Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Alessandro,

If you tie the XML definition for the HTML language to use the codebehind class (HtmlDynamicSyntaxLanguage) in our sample project you should see a member list for < being typed show up. But other than that it doesn't do much. We don't have extended functionality in most of the free sample languages like we offer in our add-ons.

Note that the "SemanticParserService.Start()" is not needed there though since that implementation is very simplistic and doesn't do any extensive parsing, nor does it use the service.

Actipro Software Support
Posted 5 years ago by Alessandro Sorcinelli
Thanks it's work well.

Last question: now I'm tring to open a dialog Window with a small editor that must handle only VB.NET files.
I would like to have Intellisense like the one that I see in your demo.
My init code is the seguent:

SemanticParserService.Start()

Dim path As String = Application.StartupPath + "\cache\"
dotNetProjectResolver.CachePath = path
dotNetProjectResolver.AddExternalReferenceForMSCorLib()
dotNetProjectResolver.AddExternalReferenceForSystemAssembly("System")
dotNetProjectResolver.AddExternalReferenceForSystemAssembly("System.Data")
dotNetProjectResolver.AddExternalReferenceForSystemAssembly("System.Drawing")
dotNetProjectResolver.AddExternalReferenceForSystemAssembly("System.Windows.Forms")
' Load the language definitions (reuse language instance)
Dim vbLanguage As VBSyntaxLanguage = New VBSyntaxLanguage()
editor.Document.Language = vbLanguage
editor.Document.LanguageData = dotNetProjectResolver


I don't have error, but when I write "Dim i as ... " the Intelliprompt pop up with only the base types (String, Boolean, etc..).
And if I use a complex object (TextBox for example), the Intelliprompt don't shows the properties and methods.

Where is the problem?

Thanks in advance.
Alessandro
Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Make sure you do the "SemanticParserService.Start()" at your application startup.

I think you are missing that the document needs its Filename set. Even if you make it some GUID value, set it to something. Then it should work. Be sure you read the "Key Steps for Getting Started" part of the main .NET Add-on documentation since that talks about all this.

Actipro Software Support
Posted 5 years ago by Alessandro Sorcinelli
Ok, I figure out the problem.
I didn't have imports, class definition, and so on. Infact I need to edit only a function or a sub.

So my next step is to try the code fragments way, but I have another problem.
I copy the source code from your example. I remove the C# syntax object and replace with VB.NET.

In the header text I put these lines:

Imports System
Imports System.Drawing
Imports System.Windows.Forms

Public Class TestClass


In the footer text only this line:

End Class

Now if I put these simple two lines of code I have an error on the second line:

Private Sub Test()
End Sub


The editor tells: "Sub expected".
If I remove the class definitions lines from Header and Footer all works fine.
What is the error? Why the previous definition raises an error?

Thanks,
Alessandro
Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Make sure you have a line feed at the end of your header. Otherwise when the header is combined with text, it will be parsing something like:
Imports System.Windows.FormsPublic Class TestClass

Actipro Software Support
Posted 5 years ago by Alessandro Sorcinelli
Thanks!
It was the header line feed.
Now I have a good solution and I can submit it to my boss for the final approval.

Thanks again for the support.

Alessandro
Information The latest build of this product (2014.1 build 0321) was released 21 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.