mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
update: remove context.services.config?.getUserMemory() logic from project level memory show
This commit is contained in:
@@ -51,23 +51,34 @@ export const memoryCommand: SlashCommand = {
|
|||||||
description: 'Show project-level memory contents.',
|
description: 'Show project-level memory contents.',
|
||||||
kind: CommandKind.BUILT_IN,
|
kind: CommandKind.BUILT_IN,
|
||||||
action: async (context) => {
|
action: async (context) => {
|
||||||
const memoryContent =
|
try {
|
||||||
context.services.config?.getUserMemory() || '';
|
const projectMemoryPath = path.join(process.cwd(), 'QWEN.md');
|
||||||
const fileCount =
|
const memoryContent = await fs.readFile(
|
||||||
context.services.config?.getGeminiMdFileCount() || 0;
|
projectMemoryPath,
|
||||||
|
'utf-8',
|
||||||
|
);
|
||||||
|
|
||||||
const messageContent =
|
const messageContent =
|
||||||
memoryContent.length > 0
|
memoryContent.trim().length > 0
|
||||||
? `Project memory content from ${fileCount} file(s):\n\n---\n${memoryContent}\n---`
|
? `Project memory content from ${projectMemoryPath}:\n\n---\n${memoryContent}\n---`
|
||||||
: 'Project memory is currently empty.';
|
: 'Project memory is currently empty.';
|
||||||
|
|
||||||
context.ui.addItem(
|
context.ui.addItem(
|
||||||
{
|
{
|
||||||
type: MessageType.INFO,
|
type: MessageType.INFO,
|
||||||
text: messageContent,
|
text: messageContent,
|
||||||
},
|
},
|
||||||
Date.now(),
|
Date.now(),
|
||||||
);
|
);
|
||||||
|
} catch (_error) {
|
||||||
|
context.ui.addItem(
|
||||||
|
{
|
||||||
|
type: MessageType.INFO,
|
||||||
|
text: 'Project memory file not found or is currently empty.',
|
||||||
|
},
|
||||||
|
Date.now(),
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user