botbuilder-tools icon indicating copy to clipboard operation
botbuilder-tools copied to clipboard

[Adaptive] [LG] Create tooling to auto generate LG Template constants from LG files

Open DingmaomaoBJTU opened this issue 6 years ago • 2 comments
trafficstars

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

4.6.0-Daily-2019-07-17-01

Describe the bug

While using LG template in legacy dialogs like waterfall dialogs, incorrect/missing template name could only be found in runtime which is a little bit suffer.

Except: Have an indicator generator in VS Extension/VSCode Extension to generate all available template name list like this: image

With this indicator, developers can easily refer the template name instead of hardcoded strings to reduce runtime error.

To Reproduce

Currently this is how we call LG in waterfall: var result = await lgMultiLangEngine.Generate(turnContext, "[CancellingMessage]", null);

The [CancellingMessage] is a hardcoded string and can be easily misspelled. The code style with so many hardcoded strings is bad and when the template name is changed, it is easy to generate runtime error everywhere.

Expected behavior

Have a generator to help generate an indicator for a target LG file. And use LG like this: var result = await lgMultiLangEngine.Generate(turnContext, SendEmailResponses.CancellingMessage , null);

DingmaomaoBJTU avatar Jul 31 '19 08:07 DingmaomaoBJTU

Ah, like LUISGen...auto generate a language binding string for all template names..

tomlm avatar Aug 01 '19 16:08 tomlm

@boydc2014 - in a spirit similar to LUISGen, we should consider adding this capability to the MSLG CLI - ability to generate a C#/ TS/ JS variants.

vishwacsena avatar Aug 01 '19 18:08 vishwacsena