Skip to content

Generate DotNet (C#) names & package info in documentations #149

Closed

Description

@RomainMuller

As a follow up to #130, add code necessary to generate native type names for C# as well as the necessary package coordinates (NuGet link, instructions to add dependency or install package).

Activity

  1. RomainMuller commented on Aug 6, 2018

    @RomainMuller
    ContributorAuthor

    It may be interesting to factor some of the logic that currently lives in the jsii-dotnet-generator with respects to name disambiguation in the compiler, so it can be reflected in the spec (maybe the spec could for example carry some "name hints"? This would make it easier to share the same behavior in the generator and in the documentation generator...

    @mpiroc do you have anything against the idea? Or stuff we should be particularly careful about? I know it's a bit sensitive in the DotNet world, so I don't want to make a bad step here.

  2. mpiroc commented on Aug 6, 2018

    @mpiroc
    Contributor

    That would make life a lot easier for the .NET generator. Some things to keep in mind:

    • In order to disambiguate names, the compiler needs to know the native names of every namespace, type, property, and method. This effectively means that all .NET name conversion logic would need to move to the compiler.
    • The compiler would need to search for conflicts recursively--i.e. it needs to convert every name in each dependency as well.
    • You would need to implement SyntaxFacts.GetKeywordKind(text) yourself. You can find a list of keywords here. This matters mainly for parameter names, as most other names are PascalCased and won't conflict with an all-lowercase keyword.

    If I think of anything else, I'll add it to this issue.

  3. RomainMuller commented on Aug 7, 2018

    @RomainMuller
    ContributorAuthor

    An extra thing before I forget:

    The generated names need to be stable (you don't want one of your C# names to change because some of your dependencies' implementation details have changed).

  4. added
    language/dotnet
    on Aug 11, 2018
  5. added
    feature-request
    and removed on Jan 3, 2019
  6. added this to the milestone on Jul 30, 2019
  7. assyadh commented on Aug 19, 2019

    @assyadh
    Contributor

    @RomainMuller is this still a thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestlanguage/dotnetp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions