-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Support a "getCombinedCodeFix" service #20338
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
Changes from 1 commit
5c70641
be19542
8a1865f
b89b7fe
a8b3afc
a38216c
c621e3f
d0af16a
2db8649
f2031be
79c0150
8a61761
41c5710
87d30c0
5f7ba73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,9 +99,12 @@ namespace ts.server.protocol { | |
BreakpointStatement = "breakpointStatement", | ||
CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", | ||
GetCodeFixes = "getCodeFixes", | ||
ApplyCodeActionCommand = "applyCodeActionCommand", | ||
/* @internal */ | ||
GetCodeFixesFull = "getCodeFixes-full", | ||
GetCombinedCodeFix = "getCombinedCodeFix", | ||
/* @internal */ | ||
GetCombinedCodeFixFull = "getCombinedCodeFix", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "getCombinedCodeFix-full"? |
||
ApplyCodeActionCommand = "applyCodeActionCommand", | ||
GetSupportedCodeFixes = "getSupportedCodeFixes", | ||
|
||
GetApplicableRefactors = "getApplicableRefactors", | ||
|
@@ -533,6 +536,11 @@ namespace ts.server.protocol { | |
arguments: CodeFixRequestArgs; | ||
} | ||
|
||
export interface GetCombinedCodeFixRequest extends Request { | ||
command: CommandTypes.GetCombinedCodeFix; | ||
arguments: GetCombinedCodeFixRequestArgs; | ||
} | ||
|
||
export interface ApplyCodeActionCommandRequest extends Request { | ||
command: CommandTypes.ApplyCodeActionCommand; | ||
arguments: ApplyCodeActionCommandRequestArgs; | ||
|
@@ -585,6 +593,10 @@ namespace ts.server.protocol { | |
errorCodes?: number[]; | ||
} | ||
|
||
export interface GetCombinedCodeFixRequestArgs extends FileRequestArgs { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a |
||
groupId: {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would not this be |
||
} | ||
|
||
export interface ApplyCodeActionCommandRequestArgs { | ||
/** May also be an array of commands. */ | ||
command: {}; | ||
|
@@ -1568,7 +1580,7 @@ namespace ts.server.protocol { | |
|
||
export interface CodeFixResponse extends Response { | ||
/** The code actions that are available */ | ||
body?: CodeAction[]; | ||
body?: CodeFix[]; | ||
} | ||
|
||
export interface CodeAction { | ||
|
@@ -1580,6 +1592,16 @@ namespace ts.server.protocol { | |
commands?: {}[]; | ||
} | ||
|
||
export interface CodeActionAll { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
changes: FileCodeEdits[]; | ||
commands: {}[] | undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not optional instead? |
||
} | ||
|
||
export interface CodeFix extends CodeAction { | ||
/** If present, one may call 'getAllCodeFixesInGroup' with this groupId. */ | ||
groupId: {} | undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not optional instead. |
||
} | ||
|
||
/** | ||
* Format and format on key response message. | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this always be currentFile. Api call returns TextChangeRange which has file name per change.. So wouldnt it need to verify all those files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an assertion that all changes are for the current file and a TODO for if we need to test changes affecting multiple files.