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

Default namespace for F# item templates #160

Merged

Conversation

Mrxx99
Copy link
Contributor

@Mrxx99 Mrxx99 commented Jan 16, 2023

In my pull request for default namespace for item templates (only C#) #154 I wrote that this approach only works for C#.
I was wrong, I just noticed that you will only get this result
grafik
when the project was not built yet, after dotnet build was executed it works fine as expected.
I also noticed that for C# this is the exact same behavior.
When this message appears the default namespace "AvaloniaAppTemplate.Namespace" is used.

@Mrxx99
Copy link
Contributor Author

Mrxx99 commented Jan 16, 2023

@Takoooooo Another thing I noticed for item templates namespace parameter is not clear.
The readme specifies "-na Namespace" as short option but currently it is "-p:n Namespace".
I really prefer the first one and find the other one ugly and not nice to type, should I change the short option to "-na" to match the readme in another pull request?

@Takoooooo
Copy link
Contributor

@Takoooooo Another thing I noticed for item templates namespace parameter is not clear. The readme specifies "-na Namespace" as short option but currently it is "-p:n Namespace". I really prefer the first one and find the other one ugly and not nice to type, should I change the short option to "-na" to match the readme in another pull request?

These two work normally for me. Both -na namespace and -p:n namespace. As i know these two parameters are just .NET CLI defaults which can be used independently so i think you don't need to change anything

@Takoooooo Takoooooo merged commit f05583b into AvaloniaUI:master Jan 18, 2023
@Takoooooo
Copy link
Contributor

Not sure about this feature now because it takes like 30s to generate a simple item template when there is no solution or project where it can infer namespace from. Do you have any ideas how we can fix that @Mrxx99 ?

@Mrxx99
Copy link
Contributor Author

Mrxx99 commented Jan 20, 2023

@Takoooooo Is that a common use case to create an item template outside of a project?
Also for me it took only long (11s) when I created inside the template repo, did you also do that there?
If I create it in any other folder it is fast. I guess this has something to do with the Avalonia.Templates.csproj file for which it can't determine the namespace, maybe because of the template configuration in it.
I guess a bit of a problem is that the tests are also running in a folder in scope of the Avalonia.Templates.csproj, to change that the layout has to be changed, so the csrpoj is not in the root folder of the repo.

@Takoooooo
Copy link
Contributor

@Takoooooo Is that a common use case to create an item template outside of a project? Also for me it took only long (11s) when I created inside the template repo, did you also do that there? If I create it in any other folder it is fast. I guess this has something to do with the Avalonia.Templates.csproj file for which it can't determine the namespace, maybe because of the template configuration in it. I guess a bit of a problem is that the tests are also running in a folder in scope of the Avalonia.Templates.csproj, to change that the layout has to be changed, so the csrpoj is not in the root folder of the repo.

@Mrxx99 try creating an item template in just an empty folder,it takes like 30+s for me. Thats not a common use-case but i don't think it should take that long,even 11s thats too much IMO

@Mrxx99
Copy link
Contributor Author

Mrxx99 commented Jan 28, 2023

@Takoooooo I tried again in serveral random folder and could not reproduce it. It only happens for me inside the "avalonia-dotnet-templates" repo folder and it's subfolders . This also uses the same way the new class templates are added into the sdk (dotnet/sdk#29655) minus the option to also specify a manual namespace.

@Mrxx99 Mrxx99 deleted the feature/item-template-rootnamespace-fsharp branch June 15, 2023 16:38
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