Skip to content

Commit 1563118

Browse files
committed
Implement applyToParserConfiguration()
1 parent 3c5bd98 commit 1563118

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tsdoc-config/src/TSDocConfigFile.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { TSDocTagDefinition, TSDocTagSyntaxKind } from '@microsoft/tsdoc';
1+
import {
2+
TSDocTagDefinition,
3+
TSDocTagSyntaxKind,
4+
TSDocConfiguration
5+
} from '@microsoft/tsdoc';
26
import * as fs from 'fs';
37
import * as path from 'path';
48
import * as Ajv from 'ajv';
@@ -122,4 +126,21 @@ export class TSDocConfigFile {
122126
public addExtendsFile(otherFile: TSDocConfigFile): void {
123127
this._extendsFiles.push(otherFile);
124128
}
129+
130+
/**
131+
* Applies the settings from this config file to a TSDoc parser configuration.
132+
* Any `extendsFile` settings will also applied.
133+
*/
134+
public applyToParserConfiguration(configuration: TSDocConfiguration): void {
135+
// First apply the base config files
136+
for (const extendsFile of this.extendsFiles) {
137+
extendsFile.applyToParserConfiguration(configuration);
138+
}
139+
140+
// The apply this one
141+
for (const tagDefinition of this.tagDefinitions) {
142+
configuration.addTagDefinition(tagDefinition);
143+
configuration.setSupportForTag(tagDefinition, true);
144+
}
145+
}
125146
}

0 commit comments

Comments
 (0)