MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / removeMode

Function removeMode

src/cm/modelist.ts:75–93  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

73 * Remove language mode from CodeMirror editor
74 */
75export function removeMode(name: string): void {
76 const filename = normalizeModeKey(name);
77 const mode = modesByName[filename];
78 if (!mode) return;
79
80 delete modesByName[mode.name];
81 mode.aliases.forEach((alias) => {
82 if (modesByName[alias] === mode) {
83 delete modesByName[alias];
84 }
85 });
86
87 const modeIndex = modes.findIndex(
88 (registeredMode) => registeredMode === mode,
89 );
90 if (modeIndex >= 0) {
91 modes.splice(modeIndex, 1);
92 }
93}
94
95/**
96 * Get mode for file path

Callers 1

constructorMethod · 0.90

Calls 1

normalizeModeKeyFunction · 0.70

Tested by

no test coverage detected