mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-22 17:57:46 +00:00
fix(vscode-ide-companion): fix bugs & support terminal mode operation
This commit is contained in:
30
packages/vscode-ide-companion/src/webview/utils/diffUtils.ts
Normal file
30
packages/vscode-ide-companion/src/webview/utils/diffUtils.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Shared utilities for handling diff operations in the webview
|
||||
*/
|
||||
|
||||
import type { WebviewApi } from 'vscode-webview';
|
||||
|
||||
/**
|
||||
* Handle opening a diff view for a file
|
||||
* @param vscode Webview API instance
|
||||
* @param path File path
|
||||
* @param oldText Original content (left side)
|
||||
* @param newText New content (right side)
|
||||
*/
|
||||
export const handleOpenDiff = (
|
||||
vscode: WebviewApi<unknown>,
|
||||
path: string | undefined,
|
||||
oldText: string | null | undefined,
|
||||
newText: string | undefined,
|
||||
): void => {
|
||||
if (path) {
|
||||
vscode.postMessage({
|
||||
type: 'openDiff',
|
||||
data: { path, oldText: oldText || '', newText: newText || '' },
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
export function isDevelopmentMode(): boolean {
|
||||
// TODO: 调试用
|
||||
// return false;
|
||||
return (
|
||||
process.env.NODE_ENV === 'development' ||
|
||||
process.env.DEBUG === 'true' ||
|
||||
process.env.NODE_ENV !== 'production'
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user