Closed
Description
The text edits supplied with InlayHints don't always provide code that will compile eg adding the inlay hint to a closure argument would generate invalid code
func test(_ process: (String) -> ()) {
process("hello")
}
test { string in
print(string)
}
The inlay hint for string is : String
. The text edit that goes along with it is the same and inserting it would generate the following code
test { string: String in
print(string)
}
which does not compile.
Another example is enums with associated values
case .test(let value):
becomes
case .test(let value: (String)):
Maybe we should disable the text edit option until we can be sure it returns valid code.
See swiftlang/vscode-swift#554 where this was originally reported
Metadata
Metadata
Assignees
Labels
No labels