Skip to content

Commit a081765

Browse files
CopilotBernardXiong
andcommitted
refactor: Comment out vscode-kconfig-visual-editor support until ready
- Comment out vscode-kconfig-visual-editor detection and handling - Keep the abstraction framework with TODO comments - Fix error message to be more accurate (open or display) - Remove unreachable else block as it's no longer needed Co-authored-by: BernardXiong <[email protected]>
1 parent 4c4fefc commit a081765

File tree

2 files changed

+29
-33
lines changed

2 files changed

+29
-33
lines changed

src/project/cmd.ts

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,27 @@ export function configProject(arg: any) {
4747
executeCommand('cd ' + arg.fn);
4848
// Execute the extension command
4949
vscode.commands.executeCommand(menuconfigMethod.command);
50-
}
51-
// For vscode-kconfig-visual-editor, we need to open the Kconfig file explicitly
52-
else if (menuconfigMethod.command === MENUCONFIG_COMMANDS.KCONFIG_VISUAL_EDITOR) {
53-
const kconfigPath = path.join(arg.fn, 'Kconfig');
54-
if (fs.existsSync(kconfigPath)) {
55-
// Open the Kconfig file with the visual editor
56-
vscode.workspace.openTextDocument(kconfigPath).then(
57-
doc => {
58-
vscode.window.showTextDocument(doc);
59-
},
60-
error => {
61-
vscode.window.showErrorMessage(`Failed to open Kconfig file: ${error.message}`);
62-
// Fallback to terminal on error
63-
executeTerminalMenuconfig(arg.fn);
64-
}
65-
);
66-
} else {
67-
// Fallback to terminal if Kconfig doesn't exist
68-
executeTerminalMenuconfig(arg.fn);
69-
}
70-
}
71-
else {
72-
// Generic extension command
73-
executeCommand('cd ' + arg.fn);
74-
vscode.commands.executeCommand(menuconfigMethod.command!);
7550
}
51+
// TODO: Add handling for vscode-kconfig-visual-editor when it's ready
52+
// else if (menuconfigMethod.command === MENUCONFIG_COMMANDS.KCONFIG_VISUAL_EDITOR) {
53+
// const kconfigPath = path.join(arg.fn, 'Kconfig');
54+
// if (fs.existsSync(kconfigPath)) {
55+
// // Open the Kconfig file with the visual editor
56+
// vscode.workspace.openTextDocument(kconfigPath).then(
57+
// doc => {
58+
// vscode.window.showTextDocument(doc);
59+
// },
60+
// error => {
61+
// vscode.window.showErrorMessage(`Failed to open or display Kconfig file: ${error.message}`);
62+
// // Fallback to terminal on error
63+
// executeTerminalMenuconfig(arg.fn);
64+
// }
65+
// );
66+
// } else {
67+
// // Fallback to terminal if Kconfig doesn't exist
68+
// executeTerminalMenuconfig(arg.fn);
69+
// }
70+
// }
7671
} else {
7772
// For terminal-based menuconfig
7873
executeTerminalMenuconfig(arg.fn);

src/smart.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const MENUCONFIG_COMMANDS = {
4646
* Priority:
4747
* 1. If useTerminalMenuconfig is true, always use terminal
4848
* 2. Check for rt-thread.rt-thread-kconfig extension
49-
* 3. Check for ai-embedded.vscode-kconfig-visual-editor extension
49+
* 3. Check for ai-embedded.vscode-kconfig-visual-editor extension (currently disabled)
5050
* 4. Fall back to terminal scons --menuconfig
5151
*
5252
* @param kconfigPath Optional Kconfig file path for vscode-kconfig-visual-editor
@@ -71,13 +71,14 @@ export function getMenuconfigMethod(kconfigPath?: string): MenuconfigMethod {
7171
}
7272

7373
// Priority 2: Check for vscode-kconfig-visual-editor extension
74-
const kconfigVisualEditor = vscode.extensions.getExtension('ai-embedded.vscode-kconfig-visual-editor');
75-
if (kconfigVisualEditor !== undefined) {
76-
return {
77-
type: 'extension',
78-
command: MENUCONFIG_COMMANDS.KCONFIG_VISUAL_EDITOR,
79-
};
80-
}
74+
// TODO: Uncomment when vscode-kconfig-visual-editor is ready
75+
// const kconfigVisualEditor = vscode.extensions.getExtension('ai-embedded.vscode-kconfig-visual-editor');
76+
// if (kconfigVisualEditor !== undefined) {
77+
// return {
78+
// type: 'extension',
79+
// command: MENUCONFIG_COMMANDS.KCONFIG_VISUAL_EDITOR,
80+
// };
81+
// }
8182

8283
// Priority 3: Fall back to terminal menuconfig
8384
return {

0 commit comments

Comments
 (0)