···8787 vim.notify("Claude binary not found. Please install claude-code CLI.", vim.log.levels.ERROR)
8888 return
8989 end
9090-9090+9191 local file_context = helpers.get_file_context()
9292 local selection = helpers.get_selection_info(opts.range > 0, opts.line1, opts.line2)
9393-9393+9494 if not selection then
9595 vim.notify("ClaudeFix requires a selection. Select text first or use a range.", vim.log.levels.WARN)
9696 return
9797 end
9898-9898+9999 -- Get diagnostics for the selected range
100100 local diagnostics = diagnostic_helpers.get_range_diagnostics(0, selection.start_line, selection.end_line)
101101-101101+102102 if not diagnostic_helpers.has_diagnostics(0, selection.start_line, selection.end_line) then
103103 vim.notify("No diagnostic issues found in selected range.", vim.log.levels.INFO)
104104 return
105105 end
106106-106106+107107 local diagnostic_info = diagnostic_helpers.format_diagnostics_for_prompt(diagnostics)
108108 local user_input = table.concat(opts.fargs, ' ')
109109 if user_input == '' then
110110 user_input = "Fix the diagnostic issues listed above"
111111 end
112112-112112+113113 local prompt = helpers.build_prompt(user_input, file_context, selection, false, diagnostic_info)
114114-114114+115115 vim.notify("Claude is analyzing and fixing diagnostic issues...", vim.log.levels.INFO)
116116-116116+117117 helpers.execute_claude_with_tools(prompt, function(response)
118118 vim.schedule(function()
119119 vim.notify("Claude diagnostic fix completed. Check the file for changes.", vim.log.levels.INFO)
···136136 range = true,
137137 desc = 'Ask Claude to edit selected code'
138138 })
139139-139139+140140 -- Register :ClaudeFix command
141141 vim.api.nvim_create_user_command('ClaudeFix', claude_fix_command, {
142142 nargs = '*',