Skip to content

In some places, a placeholder is not identified correctly #2178

@HassanTaleb90

Description

@HassanTaleb90

Description

In this example:

func <#name#>(<#parameters#>) -> <#return type#> {
	<#function body#>
}

<#name#> // FunctionDeclSyntax
<#parameters#> // FunctionParameterSyntax
<#return type#> //EditorPlaceholderTypeSyntax (no problem)
<#function body#> //EditorPlaceholderExprSyntax (no problem)

Other examples tested:

class <#name#>: <#super class#> {  // problem
	<#code#>
}

enum <#name#> {  // problem
case <#case#>
}

struct <#name#> {  // problem
	<#fields#>
}

init(<#parameters#>) {  // problem
    <#statements#>
}
convenience init(<#parameters#>) {  // problem
    <#statements#>
}

required init(<#parameters#>) {  // problem
    <#statements#>
}

import <#module#>  // problem

if #available(<#{i, mac, tv, watch}#>OS <#x.y.z#>, *) {  // 2 problems
<#API available statements#>
} else {
<#fallback statements#>
}

{ (<#parameters#>) -> <#return type#> in  // problem
    <#statements#>
}

protocol <#name#> {  // problem
	<#requirements#>
}

struct <#name#>: OptionSet {  // problem
	let rawValue: <#integer type#>

	static let <#optionA#> = <#name#>(rawValue: 1 << 0)
	static let <#optionB#> = <#name#>(rawValue: 1 << 1)
	static let <#optionC#> = <#name#>(rawValue: 1 << 2)

	static let all: <#name#> = [.<#optionA#>, .<#optionB#>, .<#optionC#>] // problem
}

typealias <#type name#> = <#type expression#>  // problem

func test<#Name#>() {  // problem
    <#statements#>
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions