Can't edit SQLParser scheme within Visual Studio Designer 2022

Using Visual Studio 2022

Drag/drop a SQLParser onto a new form
Click the “…” in the Scheme Box

Getting a messagebox with:

Not implemented: Error loading scheme:System.InvalidCastException: Unable to cast object of type ‘Alternet.Syntax.Lexer.LexScheme’ to type ‘Alternet.Syntax.Lexer.ILexScheme’.

at Alternet.Syntax.Design.SyntaxBuilderEditor.EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)

I’m not getting this error w/ CsParser (as an example).

Any workarounds?

Thanks!

Hi Todd,

We tried to reproduce this issue with both versions 9 and 10, and it seems to work fine on our tests.

As a workaround, you can use the SyntaxBuilder tool (included in the installation and available separately at:
https://alternetsoftware.blob.core.windows.net/alternet-download/AlterNET.Tools_10.0.zip

With this tool, you can load the SQL schema, change styles, and save it back.
Then, you can load this schema using sqlParser1.Scheme.LoadFile/LoadStream method (the latter can be used in case you store the schema in the application resources)

I’ve uploaded the SQL parser’s schema here:

You can also use one of the schemas we include in the installation (they can be found in
"C:\Users\Public\Documents\AlterNET Software\AlterNET Studio v.9\Demo\Resources\Editor\Schemes")

Please also note that the SQL parser uses a hard-coded parsing algorithm and only utilizes the Schema for color style definition.

These styles can also be changed at run-time like this:

        var style = sqlParser1.Scheme.Styles.FindLexStyle("numbers"); 
        style.ForeColor = Color.Red; // Change the color of numbers to red

Kind regards,
Dmitry