Skip to content

Commit

Permalink
fix: isExternal flag wasn't set properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Nov 26, 2020
1 parent 9f89bed commit 0060eb7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/converter/context.ts
Expand Up @@ -6,6 +6,7 @@ import {
ContainerReflection,
DeclarationReflection,
ReflectionKind,
ReflectionFlag,
} from "../models/index";

import type { Converter } from "./converter";
Expand Down Expand Up @@ -150,6 +151,9 @@ export class Context {
) {
const reflection = new DeclarationReflection(name, kind, this.scope);
this.addChild(reflection);
if (this.converter.isExternal(symbol)) {
reflection.setFlag(ReflectionFlag.External);
}
this.registerReflection(reflection, symbol);

this.converter.trigger(
Expand Down
5 changes: 5 additions & 0 deletions src/lib/converter/converter.ts
Expand Up @@ -384,6 +384,11 @@ export class Converter extends ChildableComponent<
return false;
}

return this.isExternal(symbol);
}

/** @internal */
isExternal(symbol: ts.Symbol) {
this.externalPatternCache ??= createMinimatch(this.externalPattern);
for (const node of symbol.getDeclarations() ?? []) {
if (
Expand Down
5 changes: 5 additions & 0 deletions src/lib/models/reflections/abstract.ts
Expand Up @@ -432,6 +432,11 @@ export abstract class Reflection {
this.name = name;
this.originalName = name;
this.kind = kind;

// If our parent is external, we are too.
if (parent?.flags.isExternal) {
this.setFlag(ReflectionFlag.External);
}
}

/**
Expand Down

0 comments on commit 0060eb7

Please sign in to comment.