sourcekit-lsp icon indicating copy to clipboard operation
sourcekit-lsp copied to clipboard

Macro Expansion Issues

Open 0xTim opened this issue 3 months ago • 5 comments

Describe the bug I'm having issues expanding macros, will use this issue to collate them as I proceed.

Issue 1 - macros not expanding correctly on error

To Reproduce Steps to reproduce the behavior:

  1. Go to https://github.com/vapor/vapor/tree/non-controller-registration
  2. Build the Development target (which fails to compile on the branch)
  3. Open routes.swift and expand the @GET macro
  4. Inner macro is not expandable

Expected behavior Can expand the inner macro to see the error from the compiler

Environment

  • OS: macOS 26
  • Swift version (output of swift --version):
    swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
    Target: arm64-apple-macosx26.0
    
  • Visual Studio Code version: Version: 1.106.2 (Universal)
  • vscode-swift version: 2.14.1

Additional context Half the time the first expanded macro doesn't show the full expanded code, but can't reliably reproduce that at the moment

0xTim avatar Nov 24 '25 00:11 0xTim