Open ketchupfriend opened 2 months ago
Macros were added in Swift 5.9 https://www.swift.org/blog/swift-5.9-released/#language-and-standard-library, and include:
Attached macros look the same as attributes, so they already get some highlighting. Freestanding macros don't seem to be supported yet, though. For example, on this sample file:
import Testing #expect(true)
Has the following tree with InspectTree:
InspectTree
(source_file ; [0, 0] - [3, 0] (import_declaration ; [0, 0] - [0, 14] (identifier ; [0, 7] - [0, 14] (simple_identifier))) ; [0, 7] - [0, 14] (ERROR ; [2, 0] - [2, 7] (ERROR)) ; [2, 0] - [2, 7] (tuple_expression ; [2, 7] - [2, 13] value: (boolean_literal))) ; [2, 8] - [2, 12]
Expected result is that expect should be identified as a macro. This example comes from swift-testing
expect
Thanks for the heads up!
Macros were added in Swift 5.9 https://www.swift.org/blog/swift-5.9-released/#language-and-standard-library, and include:
Attached macros look the same as attributes, so they already get some highlighting. Freestanding macros don't seem to be supported yet, though. For example, on this sample file:
Has the following tree with
InspectTree
:Expected result is that
expect
should be identified as a macro. This example comes from swift-testing