diff --git a/package.json b/package.json index c6a416a..9f6fe4f 100644 --- a/package.json +++ b/package.json @@ -70,27 +70,7 @@ "id": "iccoder", "label": "IC Coder" } - ], - "configuration": { - "title": "IC Coder", - "properties": { - "icCoder.backendUrl": { - "type": "string", - "default": "http://192.168.1.108:2233", - "description": "后端服务地址" - }, - "icCoder.timeout": { - "type": "number", - "default": 60000, - "description": "请求超时时间(毫秒)" - }, - "icCoder.userId": { - "type": "string", - "default": "default-user", - "description": "用户ID(临时配置)" - } - } - } + ] }, "scripts": { "vscode:prepublish": "pnpm run package", diff --git a/src/config/settings.ts b/src/config/settings.ts index 8b6e490..15ce17d 100644 --- a/src/config/settings.ts +++ b/src/config/settings.ts @@ -1,6 +1,6 @@ /** * 配置管理 - * 从 VSCode 设置读取配置项 + * 后端地址已预配置,用户无需手动设置 */ import * as vscode from "vscode"; @@ -14,7 +14,7 @@ export interface IccoderConfig { userId: string; } -/** 默认配置 */ +/** 默认配置(预配置,不暴露给用户) */ const DEFAULT_CONFIG: IccoderConfig = { backendUrl: "http://192.168.1.108:2233", timeout: 60000, @@ -23,15 +23,10 @@ const DEFAULT_CONFIG: IccoderConfig = { /** * 获取配置项 + * 直接返回预配置的值,用户无需手动配置 */ export function getConfig(): IccoderConfig { - const config = vscode.workspace.getConfiguration("icCoder"); - - return { - backendUrl: config.get("backendUrl", DEFAULT_CONFIG.backendUrl), - timeout: config.get("timeout", DEFAULT_CONFIG.timeout), - userId: config.get("userId", DEFAULT_CONFIG.userId), - }; + return { ...DEFAULT_CONFIG }; } /**