Skip to content

feat: inlay hint for package import version status#2381

Open
QuadnucYard wants to merge 6 commits intoMyriad-Dreamin:mainfrom
QuadnucYard:import-package-decoration
Open

feat: inlay hint for package import version status#2381
QuadnucYard wants to merge 6 commits intoMyriad-Dreamin:mainfrom
QuadnucYard:import-package-decoration

Conversation

@QuadnucYard
Copy link
Copy Markdown
Contributor

Displays inline decorations showing whether a package version is up-to-date, upgradable, or invalid.

image

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @QuadnucYard, 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 editor experience by providing immediate visual feedback on the status of imported packages. It integrates new inlay hints that inform users whether their package versions are current, can be upgraded, or are invalid. This feature aims to improve developer productivity by making package management more transparent and accessible directly within the code.

Highlights

  • New Feature: Package Version Inlay Hints: Introduced inlay hints that display the status of package imports (up-to-date, upgradable, or invalid) directly in the editor.
  • Configuration Option: Added a new configuration setting, tinymist.inlayHints.packageVersionStatus, allowing users to enable or disable this feature, which is enabled by default.
  • Code Refactoring: Extracted the logic for parsing package import strings into a dedicated utility function, parse_package_import, improving code reusability and maintainability.
  • Localization Support: Added new localization strings for the package version status messages and tooltips in both English and Chinese.
  • New Test Fixtures: Included new test files (package_import.typ and its snapshot) to ensure the correct behavior of the package version inlay hints.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@QuadnucYard
Copy link
Copy Markdown
Contributor Author

The snapshots contain l10n messages that require #2380 to correctly display.

Copy link
Copy Markdown
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 introduces a helpful feature to display inlay hints for package import versions, indicating whether they are up-to-date, upgradable, or invalid. The implementation is well-structured, with logic correctly separated into different modules. I've identified a couple of areas for improvement regarding code duplication and logical correctness, along with a minor refactoring suggestion for better code style and a fix for a typo in a test snapshot. Overall, this is a great addition.

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.

1 participant