Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function buildSymbolTree(
file: string,
source: SourceFile,
config: LanguageConfig,
plugins: string[],
plugins: Array<string | [string, any]>,
): Symbol {
const moduleSymbol = SymbolUtils.createModuleSymbol();
let ast;
Expand Down
1 change: 1 addition & 0 deletions packages/webdoc-parser/src/symbols-babel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const defaultPreset = [
"classPrivateMethods",
"classPrivateProperties",
"classProperties",
["decorators", {decoratorsBeforeExport: true}],
"doExpressions",
"dynamicImport",
"exportDefaultFrom",
Expand Down
13 changes: 13 additions & 0 deletions packages/webdoc-parser/test/lang-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,17 @@ describe("@webdoc/parser.LanguageIntegration{@lang js}", function() {
`),
).to.not.throw();
});

it("should work with decorators", function() {
const symtree = buildSymbolTree(`
class DecoratorGarden {
@decorator({ withParam: 'some-value' })
decorated() {

}
}
`);

expect(symtree.members[0].members.length).to.equal(1);
});
});
13 changes: 13 additions & 0 deletions packages/webdoc-parser/test/lang-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,17 @@ describe("@webdoc/parser.LanguageIntegration{@lang ts}", function() {
expect(specializedArrayBufferImpl.meta.implements[0]).to.equal("Special.IArrayBuffer");
expect(specializedArrayBufferImpl.meta.extends[0]).to.equal("Special.ArrayBuffer");
});

it("should work with decorators", function() {
const symtree = buildSymbolTree(`
class DecoratorGarden {
@decorator({ withParam: 'some-value' })
decorated() {

}
}
`, "*.ts");

expect(symtree.members[0].members.length).to.equal(1);
});
});