Skip to content

Commit 81608ce

Browse files
committed
Bring back fileName property on ReflectionSymbolId
1 parent c348426 commit 81608ce

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ title: Changelog
2626
- `Deserializer.reviveProject(s)` no longer accepts an option to add project documents.
2727
- `Deserializer.reviveProjects` now requires an `alwaysCreateEntryPointModule` option.
2828
- `Comment.serializeDisplayParts` no longer requires a serializer argument.
29-
- `ReflectionSymbolId.fileName` has been removed, TypeDoc now stores a combination of a package name and package relative path instead.
29+
- `ReflectionSymbolId.fileName` is now optional, TypeDoc now stores a combination of a package name and package relative path instead.
30+
The `fileName` property will be present when initially created, but is not serialized.
3031
- Removed `DeclarationReflection.relevanceBoost` attribute which was added for plugins, but never used.
3132
- `i18n` proxy is no longer passed to many functions, instead, reference `i18n` exported from the module directly.
3233
- `ReflectionKind.singularString` and `ReflectionKind.pluralString` now returns translated strings.

src/lib/converter/factories/symbol-id.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function createSymbolId(symbol: ts.Symbol, declaration?: ts.Declaration)
4646
});
4747
id.pos = pos;
4848
id.transientId = transientId;
49+
id.fileName = normalizePath(sourceFileName);
4950

5051
return id;
5152
}

src/lib/models/ReflectionSymbolId.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ export class ReflectionSymbolId {
5555
*/
5656
transientId: number = NaN;
5757

58+
/**
59+
* Note: This is **not** serialized, only {@link packageName} and {@link packagePath} path
60+
* information is preserved when serializing. This is set so that it is available to plugins
61+
* when initially converting a project.
62+
*
63+
* @privateRemarks
64+
* This is used by typedoc-plugin-dt-links to determine the path to read to get the source
65+
* code of a definitely typed package.
66+
*/
67+
fileName?: NormalizedPath;
68+
5869
constructor(json: JSONOutput.ReflectionSymbolId) {
5970
this.packageName = json.packageName;
6071
this.packagePath = json.packagePath;

0 commit comments

Comments
 (0)