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

[BUG] Multiple classes in the same file get the same description #118

Closed
mcleary opened this issue Feb 22, 2017 · 4 comments
Closed

[BUG] Multiple classes in the same file get the same description #118

mcleary opened this issue Feb 22, 2017 · 4 comments

Comments

@mcleary
Copy link

mcleary commented Feb 22, 2017

Overview of the issue

I have a few typescript classes in a single file. I documented each one of the classes but the generated documentation uses the description of the first class only.

Perhaps the typescript parser compodoc uses does not support multiple classes in the same file, so I would like to know if there is a way to keep multiple classes in the same file while generating the correct documentation files.

Operating System, Node.js, npm, compodoc version(s)

OS: macOS 10.11
node.js: v7.5.0
npm: 4.2.0
compodoc: 0.0.41

Angular configuration, a package.json file in the root folder
{
  "name": "siase-frontend",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve --host=0.0.0.0",
    "compodoc": "./node_modules/.bin/compodoc -p src/tsconfig.json -s",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^2.4.7",
    "@angular/compiler": "^2.4.7",
    "@angular/core": "^2.4.7",
    "@angular/forms": "^2.4.7",
    "@angular/http": "^2.4.7",
    "@angular/material": "^2.0.0-beta.2",
    "@angular/platform-browser": "^2.4.7",
    "@angular/platform-browser-dynamic": "^2.4.7",
    "@angular/router": "^3.4.7",
    "@swimlane/ngx-datatable": "^6.1.2",
    "amazon-cognito-identity-js": "^1.15.0",
    "angular2-fontawesome": "^0.8.0",
    "angular2-jwt": "^0.1.28",
    "angular2-moment": "^1.2.0",
    "angular2-uuid": "^1.1.1",
    "aws-sdk": "^2.14.0",
    "bootstrap": "^4.0.0-alpha.6",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "moment": "^2.17.1",
    "ng2-file-upload": "^1.2.0",
    "rxjs": "^5.1.1",
    "ts-helpers": "^1.1.2",
    "zone.js": "^0.7.7"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0-beta.31",
    "@angular/compiler-cli": "^2.4.7",
    "@angular/tsc-wrapped": "^0.5.2",
    "@types/jasmine": "2.5.43",
    "@types/node": "^7.0.5",
    "codelyzer": "^2.0.0",
    "compodoc": "^0.0.41",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.4.1",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.1.0",
    "karma-remap-istanbul": "^0.6.0",
    "mark.js": "github:julmot/mark.js",
    "protractor": "5.1.1",
    "ts-node": "2.1.0",
    "tslint": "^4.4.2",
    "typescript": "~2.1.6",
    "webdriver-manager": "12.0.2"
  }
}
Compodoc installed globally or locally ?

Compodoc installed globally

Motivation for or Use Case

I think that the correct behaviour should be each class with its own class description and documentation.

Reproduce the error
  • Run compodoc with the following class hierarchy
  • Check the generated documentation
/**
 * Classe base que representa uma atividade a ser logada no DynamoDB
 */
export abstract class LogActivityDetails {

  /**
   * Retorna o mapa de atributos a ser armazenado no campo "extra" da tabela do DynamoDB
   *
   * @return {AttributeMap} retorna um mapa de atributos que pode ser escrito no DynamoDB
   */
  public abstract getDynamoDBRepresentation(): AttributeMap;
}

/**
 * Detalhes de uma operação de atualização de perfil de usuário
 */
export class LogUpdateProfileDetails extends LogActivityDetails {

  constructor(
    public newName: string,
    public success: boolean
  ) {
    super();
  }

  getDynamoDBRepresentation(): AttributeMap {

    return {
      newName: { S: this.newName },
      success: { BOOL: this.success }
    };

  }
}

Base Class Documentation

screen shot 2017-02-22 at 2 52 22 pm

Derived Class Documentation
screen shot 2017-02-22 at 2 52 37 pm

Note that the content is the same for both the base and derived classes.

@patrickracicot
Copy link

patrickracicot commented May 18, 2017

I don't if I should log a new Issue, but this is still present if we export 2 classes in the same file.

export class assignStaffTab {
	tabId: string;
	tabText: string;
	isValid: boolean;
}

@Component({
	moduleId: module.id,
	selector: 'assignment-period-staff-position',
	templateUrl: 'assignment-period-staff-position.component.html',
	styleUrls: ['assignment-period-staff-position.component.css']
})
export class AssignmentPeriodStaffPositionComponent extends BaseComponent {
	constructor(){}
}

@YoussefTaghlabi
Copy link

YoussefTaghlabi commented May 20, 2017

@vogloblinsky I'm experiencing the same issue than @patrickracicot; When exporting multiple classes within the same file, the generated documentation uses the description of the first class only.

@vogloblinsky shall I open a new issue?

@vogloblinsky
Copy link
Contributor

@YoussefTaghlabi No, just reopened the issue

@lock
Copy link

lock bot commented Oct 1, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants