-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add almost testable comments to .scm
files
#1535
Add almost testable comments to .scm
files
#1535
Conversation
( | ||
[ | ||
;;!! (const | let) foo = ...; | ||
;;! --------------^^^------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that I merged into one line for compactness
( | ||
[ | ||
;;!! (const | let) foo = ...; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the (const | let)
and ...
make this not strictly Javascript, so doesn't fully implement the idea from #1524 (comment). On the fence about whether we want to go all out and make these testable or just use it as a convenient notation
I wonder if in cases where it's not fully valid syntax we leave off the !!
so that future auto testing impl doesn't pick these up 🤔. Or maybe we leave it so that we're forced to clean these up if we go down that road
We could also leave off the !!
and !
altogether, but in some cases the clarity is helpful; see below
Or we could think about having a different marker eg ;;!?
or ;;!~
that indicates that we're using a limited set of regex-style expansions and then actually support these 🤷♂️. We wouldn't support the ...
tho; would need to replace that with something valid but that's not much of a loss
(jsx_element | ||
(jsx_closing_element) @xmlEndTag @xmlBothTags | ||
(#allow-multiple! @xmlBothTags) | ||
) @_.domain | ||
|
||
;;!! <foo/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no annotation below, it's implied that the whole thing is the content range and domain
;;!! <>foo</> | ||
;;! {} {} | ||
;;! -- --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the example that motivated me to use the !!
and !
, because in this case it might not be clear what's code and what's annotations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that I'm including multiple scopes on one line here, as otherwise it gets pretty long
38ee670
to
43690c8
Compare
See #1524 (comment)
Checklist