()
| 12 | }); |
| 13 | |
| 14 | function generateHints() { |
| 15 | const registeredCommands = getRegisteredCommands(); |
| 16 | const hints = []; |
| 17 | |
| 18 | registeredCommands.forEach(({ name, description, key }) => { |
| 19 | const keyLabel = key ? key.split("|")[0] : ""; |
| 20 | const item = (recentlyUsed) => ({ |
| 21 | value: name, |
| 22 | text: `<span ${recentlyUsed ? `data-str='${strings["recently used"]}'` : ""}>${description ?? name}</span><small>${keyLabel}</small>`, |
| 23 | }); |
| 24 | if (recentCommands.commands.includes(name)) { |
| 25 | hints.unshift(item(true)); |
| 26 | return; |
| 27 | } |
| 28 | hints.push(item(false)); |
| 29 | }); |
| 30 | |
| 31 | return hints; |
| 32 | } |
| 33 | |
| 34 | function onselect(value) { |
| 35 | const executed = executeCommand(value, editorManager.editor); |
nothing calls this directly
no test coverage detected