-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: Add Functions tips scopes #1586
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
Conversation
|
||
public class Scopes { | ||
// [END functions_tips_scopes] | ||
private static int lightComputation() { |
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.
Since these functions are excluded from the snippet, this snippet is no longer copy-paste-runnable. If you remove the region tag excludes, you can move these functions below scopeDemo
so that they are still part of the sample, but the user doesn't have to read them first.
This way the sample is still copy-paste-runnable, but the user doesn't have to read through the functions immediately.
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.
None of the languages for functions_tips_scopes
are copy-paste-runnable.
Do we want to either:
- Keep the sample consistent
- Include these functions but be inconsistent
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.
We should include these functions. It's fine for older versions of samples to be grandfathered in, but we should aim to keep newer samples up to date with our guidelines, since they were created with the user in mind.
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.
Included the functions.
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.
nit: I would still suggest moving them both below scopeDemo
(since scopeDemo
is really what you want the user to focus on).
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.
Ah. Moved the functions location to the bottom of the class.
Co-Authored-By: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
|
||
public class Scopes { | ||
// [END functions_tips_scopes] | ||
private static int lightComputation() { |
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.
nit: I would still suggest moving them both below scopeDemo
(since scopeDemo
is really what you want the user to focus on).
Anyone can merge when tests pass. |
Adds a section on Function scopes
Bug: b/132734505
Accidentally closed here: #1561