[PORT][LG] Redo the default fallback of namespace #2882
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: microsoft/BotFramework-Composer#3982
C# pr: microsoft/botbuilder-dotnet#4724
Description
Originally, the injection of LG function into Expression require a namespace option. If there is no namespace option, a absolute path is require. It is too strict.
Specific Changes
Loose the namespace fallback policy. The priority order is:
For example:
If there is an option in LG file, like:
general
is the namespace, the export function could be presented asgeneral.xxx
If there does not exist a namespace option, use the name of Id by default, for example:
If the id is:
./a.lg
->a
is the namespace,a.xxx
is the expression nameif the id is:
abc
->abc
is the namespace,abc.xxx
is the expression nameIf the is is empty string, just drop the namespace, and use template name directly,
xxx
is the final expression name