You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
addUnknownSymbolResolver accepts a resolver that receives ts.Symbol.name, however the name is insufficient to identify the symbol in cases where the symbol is namespaced such as the following:
declarenamespacefoo.bar{classBaz{}}
in the resolver this is only identified as Baz and not foo.bar.Baz
Suggested Solution
1. allow the resolver to access ts.Symbol
app.renderer.addUnknownSymbolResolver("my-package",(symbol: Symbol)=>{// get namespace from Symbol.parentreturn'';});
This would be a breaking change and may expose a more complex interface than needed(?).
2. pass the namespaced name joining ts.Symbol.parent resulting in foo.bar.Baz.
This option would not be a breaking change and is sufficient for my use case.
The text was updated successfully, but these errors were encountered:
ts.Symbol.parent is marked @internal for a reason, it's behavior isn't perfectly consistent in all cases (there's an issue about exposing it in Microsoft/TypeScript... somewhere where this was brought up)
I don't want to give resolvers access to the symbol since really they ought to be able to execute without access to the compiler (will be required if I ever get around to making it possible to generate docs from JSON, which is a rather important next step for making the packages entry point strategy usable for repos which don't release every package whenever one releases)
I've pushed a tentative fix for this, but want to look at it again this weekend before merging.
Problem
addUnknownSymbolResolver
accepts a resolver that receivests.Symbol.name
, however the name is insufficient to identify the symbol in cases where the symbol is namespaced such as the following:in the resolver this is only identified as
Baz
and notfoo.bar.Baz
Suggested Solution
1. allow the resolver to access
ts.Symbol
This would be a breaking change and may expose a more complex interface than needed(?).
2. pass the namespaced name joining
ts.Symbol.parent
resulting infoo.bar.Baz
.This option would not be a breaking change and is sufficient for my use case.
The text was updated successfully, but these errors were encountered: