Experimental support for named callback parameters

And use that in the lsp/ui implementation instead of comments.

This is only a parser support for now, the name is otherwise unused.
Hence I rather keep that experimental.
This commit is contained in:
Olivier Goffart 2024-08-16 17:39:35 +02:00
parent cb72e48aa4
commit 3a59950751
11 changed files with 97 additions and 40 deletions

View file

@ -343,7 +343,9 @@ declare_syntax! {
RepeatedElement -> [ ?DeclaredIdentifier, ?RepeatedIndex, Expression , SubElement],
RepeatedIndex -> [],
ConditionalElement -> [ Expression , SubElement],
CallbackDeclaration -> [ DeclaredIdentifier, *Type, ?ReturnType, ?TwoWayBinding ],
CallbackDeclaration -> [ DeclaredIdentifier, *CallbackDeclarationParameter, ?ReturnType, ?TwoWayBinding ],
// `foo: type` or just `type`
CallbackDeclarationParameter -> [ ?DeclaredIdentifier, Type],
Function -> [DeclaredIdentifier, *ArgumentDeclaration, ?ReturnType, CodeBlock ],
ArgumentDeclaration -> [DeclaredIdentifier, Type],
/// `-> type` (but without the ->)