[SR-6116] [SourceKit] Introduce "source.lang.swift.expr.closure" in structure #48671
Labels
closures
Feature: closures
document structure
Area → source tooling: document structure annotation
feature
A feature request or implementation
source tooling
Area: IDE support, SourceKit, and other source tooling
Additional Detail from JIRA
md5: 328c664880b57a88af33aa16267d132f
Issue Description:
It'd be useful for tools like SwiftLint to get information about closure expressions in source code.
Several rules currently need this information and obtain it using heuristics. It'd be way more reliable if this was available via SourceKit.
Some rules that could use it:
Closure End Indentation
Closure Parameter Position
Closure Spacing
Empty Parentheses with Trailing Closure
Implicit Return
Multiple Closures with Trailing Closure
Trailing Closure
Unneeded Parentheses in Closure Argument
Unused Closure Parameter
Vertical Parameter Alignment On Call
It'd be also useful to know whether a closure is a trailing closure inside a function call, but I'm not sure if it's semantically correct to add this information on this structure, because it's something available in several declarations such as
CallExpr
andSubscriptExpr
, notClosureExpr
.The text was updated successfully, but these errors were encountered: