Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT][LG] Redo the default fallback of namespace #2882

Merged
merged 1 commit into from
Oct 9, 2020
Merged

Conversation

Danieladu
Copy link
Contributor

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:

  1. If there is a namespace option, use it
  2. If there is an un-empty id, parse the file name from the id, and get the namespace
  3. If the Id is empty, just drop the namespace and use the template name as the expression name directly.

For example:
If there is an option in LG file, like:

> !# @Namespace = general

general is the namespace, the export function could be presented as general.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 name
if the id is: abc -> abc is the namespace, abc.xxx is the expression name
If the is is empty string, just drop the namespace, and use template name directly, xxx is the final expression name

@Danieladu Danieladu requested a review from a team as a code owner October 9, 2020 03:20
@Danieladu Danieladu merged commit 1b0a7d2 into main Oct 9, 2020
@Danieladu Danieladu deleted the hond/namespace branch October 9, 2020 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants