continue
continue copied to clipboard
Quick actions for more than just class/function
Validations
- [X] I believe this is a way to improve. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that requests the same enhancement
Problem
Quick actions are extremely useful. One of the things I use them for is drafting documentation comments. Because I use typescript, I often want to write documentation for types, but quick actions currently only support classes and functions. For example:
//no quick action here
interface DebugRoutes {
[key: string]: boolean;
}
//no quick action here
const DEBUG_ROUTES: DebugRoutes = {
"/user/nitawicker": true,
};
//quick action shows up here
export default async function apiFetch(path: string, options?: RequestInit): Promise<Response> {
let url = `${process.env.NEXT_PUBLIC_BACKEND_URL}${path}`;
//Check if we're in development mode and this route should return test data
if (process.env.NODE_ENV === "development") {
if (DEBUG_ROUTES[path]) {
console.log("Debug route enabled for", path);
url = `http://localhost:3000/api/test-data?route=${encodeURIComponent(path)}`;
return fetch(url, { ...options, method: "GET" });
}
}
//otherwise return real data
return fetch(url, options);
}
I am using VSCode with Continue.dev v0.8.50.
Solution
I think it would be best to solve this by letting the user define a list of places to show quick actions for. It could default to ["class", "function", "arrowFunction"] to preserve the current behavior.