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

Minor format tweak and off-by-one fix #472

Closed
wants to merge 2 commits into from

Conversation

AThePeanut4
Copy link

Firstly, thank you for developing this plugin, and for all the work you've obviously put in to the rewrite. v3 is great ❤️

This PR just makes a minor tweak and fixes an off-by-one error.

The off-by-one is for the [row, col] display. ctx.item.pos seems to be (1, 0) indexed, so the +1 should be on the column, not the row.

The tweak is for the formatting of an item's "source". Currently there are three different ways this is displayed:

  • Diagnostics have the source highlighted as a comment, before the position
  • LSP definitions/references/etc have the client name highlighted as normal text, in brackets, before the position
  • LSP incoming/outgoing calls have the client name highlighted as a "Title", without brackets, after the position

What I've done is change the LSP format strings to be more like the diagnostics one. This is what looks the nicest imo, but I don't really have a strong opinion here so if you feel differently then I don't mind changing it.

I've also changed the diagnostic formatting, so that the brackets around the code are also highlighted as a comment. Currently the brackets are shown as normal text, which looks a bit off to me, but again it's not a big deal and I wouldn't mind changing/reverting it.

These changes seem to work for me, but the code is quite complicated and I don't really understand much of what's going on - so it's very possible I've done something very wrong or missed something. Please feel free to fix/change anything if needed.

folke added a commit that referenced this pull request Jun 3, 2024
@folke
Copy link
Owner

folke commented Jun 3, 2024

I've just taken that pos fix from your PR and changed that already.
Still need to look into the format changes (later).
Thank you

@AThePeanut4 AThePeanut4 deleted the format-tweaks branch June 15, 2024 13:42
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.

None yet

2 participants