Skip to content

Conversation

@paulvanbrenk
Copy link
Contributor

Adds a refactoring to add jsdoc to classes/modules.

Builds on top of #11913

@mhegazy
Copy link
Contributor

mhegazy commented May 22, 2017

Thanks for your contribution. This PR has failing CI tests and can not be merged in at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to merge this code in, please open a new PR that has been merged and rebased with the master branch.


const fileTextChanges: FileTextChanges[] = [];
const namePos: number = variableDeclaration.name.pos;
let variableInitializerText: string = variableDeclaration.initializer.getText();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not going to work. the text from the initializer is not guaranteed to work in all places where the variable would be used. the initializer expression can contain names that have been shadowed later on and will need to be qualified accordingly . consider:

namespace N {
     export var x = 0;

     var temp = x;

    function inner(x: string) {
        console.log(temp);
    }
}

renaming temp to x is not correct, since x has a different meaning in this scope.

@mhegazy
Copy link
Contributor

mhegazy commented May 24, 2017

looking back at this PR, the infrastructure for refactoring has been added in #15569. the two additional refactorings added here do not seem salvageable either. I am not sure we even need to add a new JSDoc as a refactor, and inline temp needs to address in lining an expression correctly; this is not a simple change, and seems like a complete rewrite. closing this PR.

@mhegazy mhegazy closed this May 24, 2017
@mhegazy mhegazy deleted the pvb/refactor/jsdoc branch November 2, 2017 21:03
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants