mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
fix(vscode-ide-companion): resolve ESLint errors and improve code quality
- Fix unused variable issues by removing unused variables and renaming caught errors to match ESLint rules - Fix TypeScript type mismatches in mode handling - Add missing curly braces to if statements to comply with ESLint rules - Resolve missing dependency warnings in React hooks - Clean up empty catch blocks by adding appropriate comments - Remove unused _lastEditorState variables that were declared but never read These changes ensure the codebase passes ESLint checks and follows best practices for code quality.
This commit is contained in:
@@ -471,15 +471,27 @@ export const App: React.FC = () => {
|
||||
});
|
||||
}, [vscode]);
|
||||
|
||||
// Handle toggle edit mode
|
||||
// Handle toggle edit mode (Ask -> Auto -> Plan -> YOLO -> Ask)
|
||||
const handleToggleEditMode = useCallback(() => {
|
||||
setEditMode((prev) => {
|
||||
const next: EditMode =
|
||||
prev === 'ask' ? 'auto' : prev === 'auto' ? 'plan' : 'ask';
|
||||
prev === 'ask'
|
||||
? 'auto'
|
||||
: prev === 'auto'
|
||||
? 'plan'
|
||||
: prev === 'plan'
|
||||
? 'yolo'
|
||||
: 'ask';
|
||||
// Notify extension to set approval mode via ACP
|
||||
try {
|
||||
const toAcp =
|
||||
next === 'plan' ? 'plan' : next === 'auto' ? 'auto-edit' : 'default';
|
||||
next === 'plan'
|
||||
? 'plan'
|
||||
: next === 'auto'
|
||||
? 'auto-edit'
|
||||
: next === 'yolo'
|
||||
? 'yolo'
|
||||
: 'default';
|
||||
vscode.postMessage({
|
||||
type: 'setApprovalMode',
|
||||
data: { modeId: toAcp },
|
||||
|
||||
Reference in New Issue
Block a user