Add enumerator for MacrosParser

This commit is contained in:
Cohee
2025-01-11 19:04:36 +02:00
parent f462436450
commit 1dccb08cd6
2 changed files with 34 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import { SlashCommandBreakPoint } from './SlashCommandBreakPoint.js';
import { SlashCommandDebugController } from './SlashCommandDebugController.js';
import { commonEnumProviders } from './SlashCommandCommonEnumsProvider.js';
import { SlashCommandBreak } from './SlashCommandBreak.js';
import { MacrosParser } from '../macros.js';
/** @typedef {import('./SlashCommand.js').NamedArgumentsCapture} NamedArgumentsCapture */
/** @typedef {import('./SlashCommand.js').NamedArguments} NamedArguments */
@ -494,6 +495,9 @@ export class SlashCommandParser {
li.querySelector('tt').textContent,
(li.querySelector('tt').remove(),li.innerHTML),
));
for (const macro of MacrosParser) {
options.push(new MacroAutoCompleteOption(macro.name, `{{${macro.name}}}`, macro.description || 'No description provided'));
}
const result = new AutoCompleteNameResult(
macro.name,
macro.start + 2,