Skip to content
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

Merged

Conversation

pokey
Copy link
Member

@pokey pokey commented Jun 16, 2023

See #1524 (comment)

Checklist

(
[
;;!! (const | let) foo = ...;
;;! --------------^^^-------
Copy link
Member Author

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 = ...;
Copy link
Member Author

@pokey pokey Jun 16, 2023

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/>
Copy link
Member Author

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

Comment on lines +77 to +79
;;!! <>foo</>
;;! {} {}
;;! -- ---
Copy link
Member Author

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

Copy link
Member Author

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

@pokey pokey added the to discuss Plan to discuss at meet-up label Jun 16, 2023
@pokey pokey requested a review from AndreasArvidsson June 16, 2023 15:09
@pokey pokey force-pushed the pokey/add-almost-testable-comments-to-scm-files branch from 38ee670 to 43690c8 Compare June 16, 2023 15:13
@pokey pokey removed the to discuss Plan to discuss at meet-up label Jun 17, 2023
@pokey pokey marked this pull request as ready for review June 20, 2023 16:19
@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Jun 20, 2023
Merged via the queue into main with commit de29bdd Jun 20, 2023
@AndreasArvidsson AndreasArvidsson deleted the pokey/add-almost-testable-comments-to-scm-files branch June 20, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants