Skip to content

Commit 50faf70

Browse files
committed
fix:优化引导页
1 parent 7d691c2 commit 50faf70

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

images/guide/rightClick.png

174 KB
Loading

src/extension.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,21 @@ export async function saveAnalyzeCodeResult(request: string, respond: string){
116116
fs.writeFileSync(mdFilePath, mdContent, 'utf-8');
117117
}
118118

119+
function hideWorkspaceFolder() {
120+
const configuration = vscode.workspace.getConfiguration();
121+
configuration.update('files.exclude', {
122+
'**/.CodeReDesignWorkSpace': true
123+
}, vscode.ConfigurationTarget.Global);
124+
}
125+
119126
// 插件激活时调用
120127
export function activate(context: vscode.ExtensionContext) {
121128
console.log('Congratulations, your extension "CodeReDesign" is now active!');
122129

123130
activateGuide(context);
124131

132+
hideWorkspaceFolder();
133+
125134
// 创建输出通道
126135
const outputChannel = vscode.window.createOutputChannel('CodeReDesign API Stream', 'markdown');
127136

src/guide.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as vscode from 'vscode';
2+
import * as path from 'path';
23

34
export function activateGuide(context: vscode.ExtensionContext) {
45
const guideViewProvider = new GuideViewProvider(context);
@@ -83,6 +84,12 @@ class GuideViewProvider implements vscode.WebviewViewProvider {
8384
const customModelName = selectedCustomConfig?.modelName || '';
8485
const customModelNickname = selectedCustomConfig?.modelNickname || '';
8586
const customAPIKey = selectedCustomConfig?.modelAPIKey || '';
87+
88+
// 获取图片路径
89+
const imagePath = vscode.Uri.file(
90+
path.join(this.context.extensionPath, 'images/guide/rightClick.png')
91+
);
92+
const imageUri = imagePath.with({ scheme: 'vscode-resource' }).toString(); // 转换为 vscode-resource 协议 URL
8693

8794
return `
8895
<!DOCTYPE html>
@@ -197,6 +204,10 @@ class GuideViewProvider implements vscode.WebviewViewProvider {
197204
</li>
198205
</ul>
199206
</div>
207+
208+
<div class="section">
209+
<img src="${imageUri}" style="max-width: 100%; height: auto;">
210+
</div>
200211
201212
<script>
202213
const vscode = acquireVsCodeApi();

0 commit comments

Comments
 (0)