Skip to content

Conversation

fredzqm
Copy link
Contributor

@fredzqm fredzqm commented Oct 2, 2025

Even when project isn't present, show the "Generate Operation" code lens. Always error out suggesting connecting a Firebase Project.

Screenshot 2025-10-01 at 6 16 01 PM

Copy link
Contributor

Summary of Changes

Hello @fredzqm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience for the Firebase VS Code extension's Data Connect features by making the "Generate Operation" code lens consistently visible. This change allows users to see the available action earlier, while robustly handling the requirement for a connected Firebase project by adding a runtime check and informative error message when the operation is actually triggered.

Highlights

  • Code Lens Visibility: The "Generate Operation" code lens will now always be displayed in VS Code for Data Connect operations, regardless of whether a Firebase project is currently connected.
  • Optional Project ID: The projectId field in the GenerateOperationInput interface has been made optional to support the always-on code lens.
  • Runtime Project ID Check: A check was added to the generateOperation function to ensure a projectId is present before attempting to generate an operation, providing a user-friendly error message if it's missing.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly modifies the behavior to always show the 'Generate Operation' code lens, moving the project existence check into the command handler. The changes are logical and well-implemented. I've included one suggestion to improve code readability by using a more modern loop construct.

Comment on lines +127 to +128
for (let i = 0; i < comments.length; i++) {
const c = comments[i];
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For improved readability and to use a more modern TypeScript construct, you can use a for...of loop here since the index i is not used within the loop.

Suggested change
for (let i = 0; i < comments.length; i++) {
const c = comments[i];
for (const c of comments) {

@fredzqm
Copy link
Contributor Author

fredzqm commented Oct 2, 2025

@hlshen Here is a very small incremental improvement.

This can improve discoverability of this code lens even if the developer started without a project.

@fredzqm fredzqm requested a review from hlshen October 2, 2025 01:18
@fredzqm fredzqm changed the title [VS Code] Always show generate code lens [VS Code] Always show "Generate Operation" code lens Oct 2, 2025
@fredzqm fredzqm enabled auto-merge (squash) October 3, 2025 16:27
@fredzqm fredzqm disabled auto-merge October 3, 2025 16:27
@fredzqm fredzqm enabled auto-merge (squash) October 3, 2025 16:27
@fredzqm fredzqm merged commit 581b9bf into master Oct 3, 2025
48 checks passed
@fredzqm fredzqm deleted the fz/project-less-generate branch October 3, 2025 16:39
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 3, 2025
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