Skip to content

Macro Expansion Issues #1960

@0xTim

Description

@0xTim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Unscreened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions