@@ -321,6 +321,15 @@ function remove_farg_name(x, server, conn)
321321 JSONRPC. send (conn, workspace_applyEdit_request_type, ApplyWorkspaceEditParams (missing , WorkspaceEdit (missing , TextDocumentEdit[tde])))
322322end
323323
324+ function remove_unused_assignment_name (x, _, conn)
325+ x1 = StaticLint. get_parent_fexpr (x, x -> StaticLint. haserror (x) && StaticLint. errorof (x) == StaticLint. UnusedBinding && x isa EXPR && x. head === :IDENTIFIER )
326+ file, offset = get_file_loc (x1)
327+ tde = TextDocumentEdit (VersionedTextDocumentIdentifier (file. _uri, file. _version), TextEdit[
328+ TextEdit (Range (file, offset .+ (0 : x1. span)), " _" )
329+ ])
330+ JSONRPC. send (conn, workspace_applyEdit_request_type, ApplyWorkspaceEditParams (missing , WorkspaceEdit (missing , TextDocumentEdit[tde])))
331+ end
332+
324333function double_to_triple_equal (x, _, conn)
325334 x1 = StaticLint. get_parent_fexpr (x, y -> StaticLint. haserror (y) && StaticLint. errorof (y) in (StaticLint. NothingEquality, StaticLint. NothingNotEq))
326335 file, offset = get_file_loc (x1)
@@ -383,6 +392,15 @@ LSActions["DeleteUnusedFunctionArgumentName"] = ServerAction(
383392 remove_farg_name,
384393)
385394
395+ LSActions[" ReplaceUnusedAssignmentName" ] = ServerAction (
396+ " ReplaceUnusedAssignmentName" ,
397+ " Replace unused assignment name with _." ,
398+ CodeActionKinds. QuickFix,
399+ missing ,
400+ (x, params) -> StaticLint. is_in_fexpr (x, x -> StaticLint. haserror (x) && StaticLint. errorof (x) == StaticLint. UnusedBinding && x isa EXPR && x. head === :IDENTIFIER ),
401+ remove_unused_assignment_name,
402+ )
403+
386404LSActions[" CompareNothingWithTripleEqual" ] = ServerAction (
387405 " CompareNothingWithTripleEqual" ,
388406 " Change ==/!= to ===/!==." ,
0 commit comments