mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-02 21:50:52 +00:00
refactor(insight): improve error handling and format output path message
This commit is contained in:
parent
6cb0bb078c
commit
7b845ea3a6
1 changed files with 9 additions and 6 deletions
|
|
@ -32,7 +32,7 @@ async function openFileInBrowser(filePath: string): Promise<void> {
|
|||
default: // Linux and others
|
||||
await execAsync(`xdg-open "${fileUrl}"`);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (_error) {
|
||||
// If opening fails, try with local file path
|
||||
switch (process.platform) {
|
||||
case 'darwin': // macOS
|
||||
|
|
@ -71,7 +71,8 @@ export const insightCommand: SlashCommand = {
|
|||
);
|
||||
|
||||
// Generate the static insight HTML file
|
||||
const outputPath = await insightGenerator.generateStaticInsight(projectsDir);
|
||||
const outputPath =
|
||||
await insightGenerator.generateStaticInsight(projectsDir);
|
||||
|
||||
context.ui.addItem(
|
||||
{
|
||||
|
|
@ -100,16 +101,18 @@ export const insightCommand: SlashCommand = {
|
|||
context.ui.addItem(
|
||||
{
|
||||
type: MessageType.INFO,
|
||||
text: t('Insights generated at: {{path}}. Please open this file in your browser.', {
|
||||
path: outputPath,
|
||||
}),
|
||||
text: t(
|
||||
'Insights generated at: {{path}}. Please open this file in your browser.',
|
||||
{
|
||||
path: outputPath,
|
||||
},
|
||||
),
|
||||
},
|
||||
Date.now(),
|
||||
);
|
||||
}
|
||||
|
||||
context.ui.setDebugMessage(t('Insights ready.'));
|
||||
|
||||
} catch (error) {
|
||||
context.ui.addItem(
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue