Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRefactoring support #15569
Conversation
msftclas
added
the
cla-not-required
label
May 3, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Anyone want to take a look? The VS side is about to merge |
RyanCavanaugh
requested review from
billti and
mhegazy
May 8, 2017
| } | ||
| // all static members are stored in the "exports" array of symbol | ||
| if (symbol.exports) { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mhegazy
May 15, 2017
Contributor
Is this intended for a .ts or a .js file?
I think it is a .js file, since the binding for the special properties do not work in .ts files any way.
If my understanding is correct, then for static members we can not just add declarations for them, this will result in invalid .js class.
this also applies to the property declarations and assignments..
If we want this to work in a .ts file, then we need to do something with the inference to make it work first.
I would also recommend adding a check at the top of isApplicable to return if !inJavaScriptFile(node)
mhegazy
May 15, 2017
Contributor
Is this intended for a .ts or a .js file?
I think it is a .js file, since the binding for the special properties do not work in .ts files any way.
If my understanding is correct, then for static members we can not just add declarations for them, this will result in invalid .js class.
this also applies to the property declarations and assignments..
If we want this to work in a .ts file, then we need to do something with the inference to make it work first.
I would also recommend adding a check at the top of isApplicable to return if !inJavaScriptFile(node)
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mhegazy
May 15, 2017
Contributor
also for member initialization, I wounder if we can even do these correctellly...
var c = function() { this.list.push(1); }
c.prototype.list = [];is not the same as:
class c {
constructor() { this.list.push(1); }
list = [];let a side that it is not valid JS strictly speaking.
mhegazy
May 15, 2017
Contributor
also for member initialization, I wounder if we can even do these correctellly...
var c = function() { this.list.push(1); }
c.prototype.list = [];is not the same as:
class c {
constructor() { this.list.push(1); }
list = [];let a side that it is not valid JS strictly speaking.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
RyanCavanaugh
May 17, 2017
Member
Fixed these up. Non-func-expr things remain as assignments following the class body
RyanCavanaugh
May 17, 2017
Member
Fixed these up. Non-func-expr things remain as assignments following the class body
mjbvz
referenced this pull request
May 19, 2017
Closed
Support refactoring commands provided by TS Server #25739
RyanCavanaugh
merged commit f489f5a
into
Microsoft:master
May 19, 2017
RyanCavanaugh
deleted the
RyanCavanaugh:new_refactor
branch
May 19, 2017
| export type GetApplicableRefactors = "getApplicableRefactors"; | ||
| export type GetRefactorCodeActions = "getRefactorCodeActions"; | ||
| export type GetRefactorCodeActionsFull = "getRefactorCodeActions-full"; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| export type RefactorCodeActions = { | ||
| actions: protocol.CodeAction[]; | ||
| renameLocation?: number |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| program: Program; | ||
| newLineCharacter: string; | ||
| rulesProvider?: formatting.RulesProvider; | ||
| cancellationToken?: CancellationToken; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| endPosition?: number; | ||
| program: Program; | ||
| newLineCharacter: string; | ||
| rulesProvider?: formatting.RulesProvider; |
RyanCavanaugh commentedMay 3, 2017
Picks up where #14624 left off.