Skip to content

Commit

Permalink
Merge pull request #1383 from dandean/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
eventualbuddha authored May 31, 2024
2 parents aff2dea + b36db43 commit 6f7466e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,12 @@ function genericPrintNoParens(path: any, options: any, print: any) {
return concat(parts);

case "TSMethodSignature":
if (n.kind === "get") {
parts.push("get ");
} else if (n.kind === "set") {
parts.push("set ");
}

if (n.computed) {
parts.push("[", path.call(print, "key"), "]");
} else {
Expand Down
7 changes: 7 additions & 0 deletions test/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ const nodeMajorVersion = parseInt(process.versions.node, 10);
"}",
]);

check([
"interface LabelledContainer<T> {",
" get label(): string;",
" set label(a: string);",
"}",
]);

check([
"class Button extends Control<T, U> implements SelectableControl<T, U>, ClickableControl<U> {",
" select() {}",
Expand Down

0 comments on commit 6f7466e

Please sign in to comment.