Skip to content
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

Inline type hints are missing spacing #981

Closed
sebthom opened this issue May 2, 2024 · 0 comments
Closed

Inline type hints are missing spacing #981

sebthom opened this issue May 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sebthom
Copy link
Contributor

sebthom commented May 2, 2024

Currently inline type hints are rendered as follows missing any spacing to the variable name:
image

Which esp. in line 17 becomes difficult to read. In the Java Editor inline hints are suffixed with a white space. If LSP4e behaves like this, the same code would look like this:

image

Responsible for inline type hints is org.eclipse.lsp4e.operations.inlayhint.LSPLineContentCodeMining

If I override the LineContentCodeMining#setLabel method and add a whitespace to the end of the label, I get the desired effect:

@Override
public void setLabel(String label) {
  if (label != null && !label.isEmpty() && !Character.isWhitespace(label.charAt(label.length() - 1)))
    label += " ";
  super.setLabel(label);
}

@mickaelistria @rubenporras Is this an adequate way to address this issue?

@sebthom sebthom added the enhancement New feature or request label May 2, 2024
sebthom added a commit to sebthom/lsp4e that referenced this issue May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant