Skip to content

Conversation

@chengluyu
Copy link
Contributor

Hello, this is a very small change, which only modifies one line, to solve the issue raised in #199954.

The background of this PR is that, in my previous #153968, I added a new setting to support variable fonts. However, I recently found that the related setting has not been applied to the code completion list (or suggestion widget, according to the source code). I have located the bug and raised this PR.

@eleanorjboyd
Copy link
Member

Congrats! You are the 200,000 issue on the VS Code repo! 🎉

@chengluyu chengluyu changed the title Apply font-variation-settings to the suggestion widget Apply font-variation-settings to the suggestion widget (fixes #199954) Dec 5, 2023
@chengluyu chengluyu changed the title Apply font-variation-settings to the suggestion widget (fixes #199954) Apply font-variation-settings to the suggestion widget (fix #199954) Dec 5, 2023
@Nirmal4G
Copy link

Nirmal4G commented Jul 8, 2024

I'm hitting this. It's such a simple fix. Any reason, this is not merged yet?

Copy link

@Sahilcrossml Sahilcrossml left a comment

Choose a reason for hiding this comment

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

🎯 Overall Assessment

  • Recommendation: APPROVE
  • Summary: This PR introduces a minor change to apply font-variation-settings to the suggestion widget, addressing issue #199954. The change enhances the rendering of the suggestion widget by utilizing variable font settings, which were previously not applied.

📋 Code Changes Analysis

📁 src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.ts

Changes: 2 additions, 0 deletions

Old vs New Code Comparison:

// Old Code
const fontFeatureSettings = fontInfo.fontFeatureSettings;

// New Code
const fontVariationSettings = fontInfo.fontVariationSettings;
// Old Code
main.style.fontFeatureSettings = fontFeatureSettings;

// New Code
main.style.fontVariationSettings = fontVariationSettings;

Specific Issues Found:

  • Line 131: The addition of const fontVariationSettings = fontInfo.fontVariationSettings; is appropriate and correctly retrieves the variable font settings.
  • Line 145: The line main.style.fontVariationSettings = fontVariationSettings; correctly applies the variable font settings to the suggestion widget.

Suggested Fixes: No fixes are necessary as the changes are correct and align with the intended functionality.

🔍 Detailed Findings

Critical Issues (if any)

  • None identified.

Moderate Issues (if any)

  • None identified.

Minor Suggestions (if any)

  • Consider adding a comment above the new lines to explain the purpose of fontVariationSettings for future maintainers. For example:
// Retrieve and apply variable font settings for better typography support
const fontVariationSettings = fontInfo.fontVariationSettings;
main.style.fontVariationSettings = fontVariationSettings;

✅ Positive Aspects

  • The change is straightforward and effectively addresses the issue raised in #199954.
  • The code is clean and follows existing conventions.
  • The addition of variable font settings enhances the visual quality of the suggestion widget.

🚀 Recommendations

  • Ensure that the changes are tested across different variable fonts to confirm that the settings are applied correctly and that there are no regressions in the appearance of the suggestion widget.
  • Consider documenting the new setting in the project’s documentation to inform users about the support for variable fonts in the suggestion widget.

@jrieken jrieken added this to the June 2025 milestone Jun 6, 2025
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

lgtm, tho I also wonder if suggest should just use ICodeEditor#applyFontInfo so that all font tweaks are applied by default

@jrieken jrieken merged commit b3bc713 into microsoft:main Jun 6, 2025
7 checks passed
@siwenwang0803
Copy link

🤖 Secure-PR-Guard AI Code Review

Analysis completed at: 2025-06-28 20:38:55 UTC
PR: #200000

🟡 Risk Assessment: MEDIUM

  • Total Issues Found: 2
  • Security Issues: 0

🟢 Low Priority Issues

  • Line 135 (length): Line exceeds 120 characters with the addition of 'const fontVariationSettings = fontInfo.fontVariationSettings;'.
  • Line 149 (style): Missing semicolon at the end of the statement 'main.style.fontVariationSettings = fontVariationSettings'.

🔗 Powered by Secure-PR-Guard | 🛡️ OWASP LLM Top 10 Compliant

This is an automated review. Please verify critical security findings manually.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants