How to view macro expansion?

how do i view the code that a macro expands to, in VSCode? the instructions only describe how to preview macros in XCode, which i obviously have no way of accessing on linux.

3 Likes

Under “refactor” you can expand the macro in-place, which technically edits the file, but can be quickly reverted with Ctrl-Z.

2 Likes

Currently, that’s the only way to view the expanded macro. Add LSP extension request for retrieving macro expansions by fwcd · Pull Request #892 · apple/sourcekit-lsp · GitHub has some initial implementation (and some discussion) on how to show macro expansions in VS Code, if you are interested.

2 Likes