Add _MACRO_MSG support: converter, creator panel, preview#1
Open
AstrandPallas wants to merge 2 commits intomainfrom
Open
Add _MACRO_MSG support: converter, creator panel, preview#1AstrandPallas wants to merge 2 commits intomainfrom
AstrandPallas wants to merge 2 commits intomainfrom
Conversation
- talkMsgConverter.ts: Right-click "Convert to _MACRO_MSG" command that converts _TALKMSG/etc lines to _MACRO_MSG() with looked-up text - TalkMsgCreatorPanel.ts: Webview panel for composing new _MACRO_MSG calls with type/bundle/label/text inputs and live preview - extension.ts: Register new commands + add _MACRO_MSG preview regex - package.json: Add commands and editor context menu entries
- Add Content Security Policy with nonce to TalkMsgCreatorPanel webview - Add localResourceRoots restriction - Fix apostrophe → smart quote conversion in buildMacro() (ANTLR grammar compat) - Await editor.edit() in _insertAtCursor - Await convertToMacro in command registration - Remove unused DataManager import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
talkMsgConverter.ts: Right-click context menu command to convert_TALKMSG/_TALK_KEYWAIT/_EASY_OBJ_MSG/_EASY_BOARD_MSGlines to_MACRO_MSG(...)macros. Looks up message text via DataManager and embeds it inline with proper escape sequences (\n,\r,\f). Handles ASCII apostrophe → smart quote conversion for ANTLR grammar compatibility.TalkMsgCreatorPanel.ts: Webview panel for composing new_MACRO_MSGcalls with dropdowns for message type and bundle file, text input with live preview, and insert-at-cursor / copy-to-clipboard actions.extension.ts: Updated message preview regex to recognize_MACRO_MSG('TYPE', 'bundle', 'label', 'text')lines (including with trailing args). Registered both new commands.package.json: Addedrelumistudio.convertToMacroandrelumistudio.openMsgCreatorcommands with editor context menu entries.Test plan
.evfile with a_TALKMSG('file%label')line, right-click → "Convert to Macro" — verify it produces correct_MACRO_MSG(...)with message text_MACRO_MSG(...)line — verify message preview panel shows the inline text_TALKMSGpreview still works