Skip to content

Commit

Permalink
Implement Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Jul 13, 2021
1 parent d432977 commit a87ef15
Show file tree
Hide file tree
Showing 24 changed files with 1,100 additions and 616 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import software.amazon.smithy.model.knowledge.ServiceIndex;
import software.amazon.smithy.model.knowledge.TopDownIndex;
import software.amazon.smithy.model.neighbor.Walker;
import software.amazon.smithy.model.shapes.DocumentShape;
import software.amazon.smithy.model.shapes.OperationShape;
import software.amazon.smithy.model.shapes.ServiceShape;
import software.amazon.smithy.model.shapes.Shape;
Expand Down Expand Up @@ -168,8 +167,8 @@ void execute() {
shape.accept(this);
}

// Generate standard DocumentShape interface
protocolDocumentGenerator.generateStandardTypes();
// Generate any required types and functions need to support protocol documents.
protocolDocumentGenerator.generateDocumentSupport();

// Generate a struct to handle unknown tags in unions
List<UnionShape> unions = serviceShapes.stream()
Expand Down Expand Up @@ -235,12 +234,6 @@ protected Void getDefault(Shape shape) {
return null;
}

@Override
public Void documentShape(DocumentShape shape) {
protocolDocumentGenerator.addDocumentShape(shape);
return null;
}

@Override
public Void structureShape(StructureShape shape) {
if (shape.getId().getNamespace().equals(CodegenUtils.getSyntheticTypeNamespace())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ public GoWriter writePackageDocs(String docs) {
return this;
}

/**
* Writes the doc to the Go package docs that are written prior to the go package statement. This does not perform
* line wrapping and the provided formatting must be valid Go doc.
*
* @param docs documentation to write to package doc.
* @return writer
*/
public GoWriter writeRawPackageDocs(String docs) {
writeDocs(packageDocs, () -> {
packageDocs.write(docs);
});
return this;
}

/**
* Writes shape documentation comments if docs are present.
*
Expand Down
Loading

0 comments on commit a87ef15

Please sign in to comment.