Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Smithy): Remove unused Smithy4sRenderer #2548

Merged
Merged
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
62 changes: 4 additions & 58 deletions packages/quicktype-core/src/language/Scala3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ export class Scala3Renderer extends ConvenienceRenderer {
delimiter === "curly"
? ["{", "}"]
: delimiter === "paren"
? ["(", ")"]
: delimiter === "none"
? ["", ""]
: ["{", "})"];
? ["(", ")"]
: delimiter === "none"
? ["", ""]
: ["{", "})"];
this.emitLine(line, " ", open);
this.indent(f);
this.emitLine(close);
Expand Down Expand Up @@ -485,60 +485,6 @@ export class UpickleRenderer extends Scala3Renderer {
}
}

export class Smithy4sRenderer extends Scala3Renderer {
protected emitHeader(): void {
if (this.leadingComments !== undefined) {
this.emitComments(this.leadingComments);
} else {
this.emitUsageHeader();
}

this.ensureBlankLine();
this.emitLine("namespace ", this._scalaOptions.packageName);
this.ensureBlankLine();
}

protected emitTopLevelArray(t: ArrayType, name: Name): void {
const elementType = this.scalaType(t.items);
this.emitLine(["list ", name, " { member : ", elementType, "}"]);
}

protected emitTopLevelMap(t: MapType, name: Name): void {
const elementType = this.scalaType(t.values);
this.emitLine(["map ", name, " { map[ key : String , value : ", elementType, "}"]);
}

protected emitEmptyClassDefinition(c: ClassType, className: Name): void {
this.emitDescription(this.descriptionForType(c));
this.emitLine("structure ", className, "{}");
}

protected emitEnumDefinition(e: EnumType, enumName: Name): void {
this.emitDescription(this.descriptionForType(e));

this.ensureBlankLine();
this.emitItem(["enum ", enumName, " { "]);
let count = e.cases.size;
this.forEachEnumCase(e, "none", (name, jsonName) => {
// if (!(jsonName == "")) {
/* const backticks =
shouldAddBacktick(jsonName) ||
jsonName.includes(" ") ||
!isNaN(parseInt(jsonName.charAt(0)))
if (backticks) {this.emitItem("`")} else */
this.emitLine();
this.emitItem([name, ' = "', jsonName, '"']);
// if (backticks) {this.emitItem("`")}
if (--count > 0) this.emitItem([","]);
//} else {
//--count
//}
});
this.ensureBlankLine();
this.emitItem(["}"]);
}
}

export class CirceRenderer extends Scala3Renderer {
seenUnionTypes: Array<string> = [];

Expand Down
Loading