|
|
@@ -56,10 +56,26 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
|
|
|
const filePath = EditorUtils.getFilePath(document)
|
|
|
const actions: vscode.CodeAction[] = []
|
|
|
|
|
|
+ actions.push(
|
|
|
+ this.createAction(
|
|
|
+ ACTION_NAMES.ADD_TO_CONTEXT,
|
|
|
+ vscode.CodeActionKind.QuickFix,
|
|
|
+ COMMAND_IDS.ADD_TO_CONTEXT,
|
|
|
+ [
|
|
|
+ filePath,
|
|
|
+ effectiveRange.text,
|
|
|
+ effectiveRange.range.start.line + 1,
|
|
|
+ effectiveRange.range.end.line + 1,
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+
|
|
|
actions.push(
|
|
|
...this.createActionPair(ACTION_NAMES.EXPLAIN, vscode.CodeActionKind.QuickFix, COMMAND_IDS.EXPLAIN, [
|
|
|
filePath,
|
|
|
effectiveRange.text,
|
|
|
+ effectiveRange.range.start.line + 1,
|
|
|
+ effectiveRange.range.end.line + 1,
|
|
|
]),
|
|
|
)
|
|
|
|
|
|
@@ -74,6 +90,8 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
|
|
|
...this.createActionPair(ACTION_NAMES.FIX, vscode.CodeActionKind.QuickFix, COMMAND_IDS.FIX, [
|
|
|
filePath,
|
|
|
effectiveRange.text,
|
|
|
+ effectiveRange.range.start.line + 1,
|
|
|
+ effectiveRange.range.end.line + 1,
|
|
|
diagnosticMessages,
|
|
|
]),
|
|
|
)
|
|
|
@@ -83,6 +101,8 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
|
|
|
...this.createActionPair(ACTION_NAMES.FIX_LOGIC, vscode.CodeActionKind.QuickFix, COMMAND_IDS.FIX, [
|
|
|
filePath,
|
|
|
effectiveRange.text,
|
|
|
+ effectiveRange.range.start.line + 1,
|
|
|
+ effectiveRange.range.end.line + 1,
|
|
|
]),
|
|
|
)
|
|
|
}
|
|
|
@@ -92,16 +112,12 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
|
|
|
ACTION_NAMES.IMPROVE,
|
|
|
vscode.CodeActionKind.RefactorRewrite,
|
|
|
COMMAND_IDS.IMPROVE,
|
|
|
- [filePath, effectiveRange.text],
|
|
|
- ),
|
|
|
- )
|
|
|
-
|
|
|
- actions.push(
|
|
|
- this.createAction(
|
|
|
- ACTION_NAMES.ADD_TO_CONTEXT,
|
|
|
- vscode.CodeActionKind.QuickFix,
|
|
|
- COMMAND_IDS.ADD_TO_CONTEXT,
|
|
|
- [filePath, effectiveRange.text],
|
|
|
+ [
|
|
|
+ filePath,
|
|
|
+ effectiveRange.text,
|
|
|
+ effectiveRange.range.start.line + 1,
|
|
|
+ effectiveRange.range.end.line + 1,
|
|
|
+ ],
|
|
|
),
|
|
|
)
|
|
|
|