Skip to content

Differentiate an Interface and an Enum element with the same name. #262

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

Closed
MaPUILabs opened this issue Jul 28, 2016 · 6 comments
Closed
Milestone

Comments

@MaPUILabs
Copy link

Hello,

I want to link an Interface in a methode definition like this :

/**
   * Get an array of [[FooBar]]
   * @param id
   */
  public getSomeFooBar = (id : Id) : FooBar => {
    /*...*/
  };

The probleme is that I have an Interface named "FooBar", but also an Enum containing an element named "FooBar", so the link refers to the Enum and not the Interface.

Is there a way to manually specify that I want to refer to the Interface ?

@aciccarello
Copy link
Collaborator

I think this is a TypeScript issue and intentional.

@canonic-epicure
Copy link
Contributor

canonic-epicure commented Mar 26, 2019

Huh, this is still not resolved since 2016? I have exactly the same problem.

It is not reasonable to expect the "plain" [[LinkTarget]] scheme to work. Need to take into account name collisions possibility.

@aciccarello
Copy link
Collaborator

How would you expect it to know which reflection to point to?

Microsoft is working on defining a specific format for doc comments that would have a much more robust (and complex) symbol reference syntax.

@canonic-epicure
Copy link
Contributor

How would you expect it to know which reflection to point to?

By using "much more robust (and complex) symbol reference syntax" of course. The first thing that comes into mind is something like: [[interface:Name]]. But then this is can be only a shortcut too, since there can be easily 2 interfaces with the same name. The full syntax could be: [[filename.ts:interface:Name]] (just an idea).

Any link to the Microsoft work?

@aciccarello
Copy link
Collaborator

Here it is: microsoft/tsdoc#9

I think that TypeDoc should support the tsdoc syntax since it should be more standard (assuming it stabilizes) as opposed to making our own syntax.

@canonic-epicure
Copy link
Contributor

Agree. Seems they haven't decided yet?

@Gerrit0 Gerrit0 added this to the TSDoc milestone Jun 15, 2021
@Gerrit0 Gerrit0 mentioned this issue Apr 17, 2022
8 tasks
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

No branches or pull requests

3 participants