MCPcopy Create free account
hub / github.com/continuedev/continue / addEntry

Method addEntry

extensions/cli/src/util/inputHistory.ts:53–72  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

51 }
52
53 addEntry(text: string): void {
54 if (!text.trim()) return;
55
56 // Remove duplicate if it exists
57 this.history = this.history.filter((entry) => entry.text !== text);
58
59 // Add new entry at the beginning
60 this.history.unshift({
61 text,
62 timestamp: Date.now(),
63 });
64
65 // Limit history size
66 if (this.history.length > MAX_HISTORY_SIZE) {
67 this.history = this.history.slice(0, MAX_HISTORY_SIZE);
68 }
69
70 this.saveHistory();
71 this.resetNavigation();
72 }
73
74 navigateUp(currentInput: string): string | null {
75 if (this.history.length === 0) return null;

Callers 3

handleEnterKeyFunction · 0.80

Calls 2

saveHistoryMethod · 0.95
resetNavigationMethod · 0.95

Tested by

no test coverage detected