Skip to content

Fix Code Lens heredoc handling #101

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

Merged
merged 1 commit into from
Jul 5, 2023
Merged

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Jul 5, 2023

We haven't yet decided how to handle interpolation within test case names so we'll ignore them for now.

@andyw8 andyw8 requested a review from a team as a code owner July 5, 2023 20:18
@@ -64,6 +64,9 @@ def on_command(node)
# The test name may be a blank string while the code is being typed
return if first_argument.parts.empty?

# We can't handle interpolation yet
return unless first_argument.parts.all? { |part| part.is_a?(SyntaxTree::TStringContent) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(an interpolated string is represented as an array of SyntaxTree::StringEmbExpr and SyntaxTree::TStringContent)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better written as:

return if first_argument.parts.any? { |part| part.is_a?(SyntaxTree::TStringContent) }

@andyw8 andyw8 merged commit 889235d into main Jul 5, 2023
@andyw8 andyw8 deleted the andyw8/fix-code-lens-heredoc-handling branch July 5, 2023 20:34
@shopify-shipit shopify-shipit bot temporarily deployed to production July 5, 2023 20:37 Inactive
@andyw8 andyw8 added the bugfix This PR fixes an existing bug label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants