Skip to content

Code fix prefix unused2#16309

Merged
aozgaa merged 9 commits into
microsoft:masterfrom
aozgaa:codeFixPrefixUnused2
Jun 13, 2017
Merged

Code fix prefix unused2#16309
aozgaa merged 9 commits into
microsoft:masterfrom
aozgaa:codeFixPrefixUnused2

Conversation

@aozgaa
Copy link
Copy Markdown
Contributor

@aozgaa aozgaa commented Jun 6, 2017

Fixes #14420.

Note that we do not add underscores for parameter declarations or imports, as underscores do no work for suppressing unused errors for these constructs.

case ts.SyntaxKind.Identifier:
return deleteIdentifier();
let actions = deleteIdentifier(<Identifier>token);
(actions || (actions = [])).push(prefixIdentifierWithUnderscore(<Identifier>token));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should not do this all the time. only for parameters and for..of/for .. in variables

//// } |]

verify.rangeAfterCodeFix(`namespace greeter {
class _class1 { }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is still an error.

Copy link
Copy Markdown
Contributor

@mhegazy mhegazy left a comment

Choose a reason for hiding this comment

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

we need to condition the _ addition

@aozgaa
Copy link
Copy Markdown
Contributor Author

aozgaa commented Jun 9, 2017

@mhegazy can you take another look?

@aozgaa aozgaa merged commit 9cd04e0 into microsoft:master Jun 13, 2017
@aozgaa aozgaa deleted the codeFixPrefixUnused2 branch June 13, 2017 18:16
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jun 13, 2017

please port this to release-2.4

@aozgaa aozgaa restored the codeFixPrefixUnused2 branch June 13, 2017 18:18
aozgaa pushed a commit to aozgaa/TypeScript that referenced this pull request Jun 13, 2017
aozgaa added a commit that referenced this pull request Jun 14, 2017
port #16309 (prefix unused with _) to release-2.4
@aozgaa aozgaa deleted the codeFixPrefixUnused2 branch June 20, 2017 23:49
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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.

3 participants