swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.18k stars 403 forks source link

[Macros] Fix column calculation in MacroExpansionContext for plugins #2656

Closed rintaro closed 3 months ago

rintaro commented 3 months ago

When retriving a location for a node at the first line, column calculation was incorrect. 'column' of 'PluginMessage.Syntax' is 1-based, so we need to '-1' when using it as a offset.

rintaro commented 3 months ago

@swift-ci Please test

rintaro commented 3 months ago

@swift-ci Please test

ahoppen commented 3 months ago

@swift-ci Please test Windows