auto-fix system #2

Open
opened 2025-10-20 18:11:14 +02:00 by alexander.nutz · 0 comments

auto-fixes can optionally take in user input

add two ways of doing auto-fixes:

  1. replace multiple token spans or ast spans in the code with a snippet (with user inputs filled in);
    this can easily be serialized into a file.
  2. per-fix custom "apply" function, that runs after user input..
    there should be a simple registry system for this, so that they can hopefuly be serialized.

this should be future proof

Example application 1

a language server

Example application 2

# click cc test.c

At line ...
Error: .....
Fix available: click apply A1213

# click apply A1213

this could work by storing a list of the most recent suggested in the current directory

auto-fixes can optionally take in user input add two ways of doing auto-fixes: 1. replace multiple token spans or ast spans in the code with a snippet (with user inputs filled in); this can easily be serialized into a file. 2. per-fix custom "apply" function, that runs after user input.. there should be a simple registry system for this, so that they can hopefuly be serialized. this should be future proof ## Example application 1 a language server ## Example application 2 ``` # click cc test.c At line ... Error: ..... Fix available: click apply A1213 # click apply A1213 ``` this could work by storing a list of the most recent suggested in the current directory
alexander.nutz added this to the v0.1.0 milestone 2025-10-21 07:15:13 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
click-project/click#2
No description provided.