ballerina-platform / lsp4intellij

This language client library provides language server protocol support for IntelliJ IDEA and other Jetbrains IDEs.
Apache License 2.0
438 stars 104 forks source link

Fix: Hover font should use editor font settings #335

Closed gharris1727 closed 1 year ago

gharris1727 commented 1 year ago

Purpose

The Hover feature uses a fixed font size that is not configurable, and doesn't scale with the editor font size. Screenshot 2023-09-20 at 3 44 07 PM

Goals

Make the Hover display text which appears similar to the rest of the UI, such as completions and action menus.

Approach

I used the UiUtil class (already used here to get the dark/light mode) to instead get the label font and generate corresponding HTML styles. Below is a demonstration of Darcula and IntelliJ Light themes:

Screenshot 2023-09-20 at 3 45 42 PM Screenshot 2023-09-20 at 3 58 36 PM

This is an example with .AppleSystemUIFont size 18. I can't figure out what the original font or size was prior to this change, as it wasn't configurable.

User stories

A user that needs to change their font or increase their font size for accessibility will see their font size reflected in the hover similar to how it appears in the rest of the IntelliJ UI.

Release note

Documentation hover now uses the global editor font style

Automation tests

Security checks

Test environment

OpenJDK 17, arm64 mac Ventura

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.