@@ -56,10 +56,26 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
5656 const filePath = EditorUtils . getFilePath ( document )
5757 const actions : vscode . CodeAction [ ] = [ ]
5858
59+ actions . push (
60+ this . createAction (
61+ ACTION_NAMES . ADD_TO_CONTEXT ,
62+ vscode . CodeActionKind . QuickFix ,
63+ COMMAND_IDS . ADD_TO_CONTEXT ,
64+ [
65+ filePath ,
66+ effectiveRange . text ,
67+ effectiveRange . range . start . line + 1 ,
68+ effectiveRange . range . end . line + 1 ,
69+ ] ,
70+ ) ,
71+ )
72+
5973 actions . push (
6074 ...this . createActionPair ( ACTION_NAMES . EXPLAIN , vscode . CodeActionKind . QuickFix , COMMAND_IDS . EXPLAIN , [
6175 filePath ,
6276 effectiveRange . text ,
77+ effectiveRange . range . start . line + 1 ,
78+ effectiveRange . range . end . line + 1 ,
6379 ] ) ,
6480 )
6581
@@ -74,6 +90,8 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
7490 ...this . createActionPair ( ACTION_NAMES . FIX , vscode . CodeActionKind . QuickFix , COMMAND_IDS . FIX , [
7591 filePath ,
7692 effectiveRange . text ,
93+ effectiveRange . range . start . line + 1 ,
94+ effectiveRange . range . end . line + 1 ,
7795 diagnosticMessages ,
7896 ] ) ,
7997 )
@@ -83,6 +101,8 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
83101 ...this . createActionPair ( ACTION_NAMES . FIX_LOGIC , vscode . CodeActionKind . QuickFix , COMMAND_IDS . FIX , [
84102 filePath ,
85103 effectiveRange . text ,
104+ effectiveRange . range . start . line + 1 ,
105+ effectiveRange . range . end . line + 1 ,
86106 ] ) ,
87107 )
88108 }
@@ -92,16 +112,12 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
92112 ACTION_NAMES . IMPROVE ,
93113 vscode . CodeActionKind . RefactorRewrite ,
94114 COMMAND_IDS . IMPROVE ,
95- [ filePath , effectiveRange . text ] ,
96- ) ,
97- )
98-
99- actions . push (
100- this . createAction (
101- ACTION_NAMES . ADD_TO_CONTEXT ,
102- vscode . CodeActionKind . QuickFix ,
103- COMMAND_IDS . ADD_TO_CONTEXT ,
104- [ filePath , effectiveRange . text ] ,
115+ [
116+ filePath ,
117+ effectiveRange . text ,
118+ effectiveRange . range . start . line + 1 ,
119+ effectiveRange . range . end . line + 1 ,
120+ ] ,
105121 ) ,
106122 )
107123
0 commit comments