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

feat(inlayHint): add inlayHint.position configuration #5060

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

de-vri-es
Copy link
Contributor

This PR adds an option to move all inlay hints to after the original text.

Personally, I find hints inside the source code very distracting. And they make the code look much wider than it really is, which I personally do not like.

This option allows to restore the old behavior where all hints were displayed at the end of a line.

@fannheyward
Copy link
Member

Thank you for your PR! Please change the configuration to inlayHint.position, with inline and eol options.

#4740

@de-vri-es de-vri-es force-pushed the inlay-hints-after-text branch 2 times, most recently from 12dfe6c to 4413163 Compare June 27, 2024 09:52
@fannheyward fannheyward changed the title feat(inlayHint): add afterText option to move hints after text feat(inlayHint): add inlayHint.position configuration Jun 27, 2024
@fannheyward fannheyward changed the title feat(inlayHint): add inlayHint.position configuration feat(inlayHint): add inlayHint.position configuration Jun 27, 2024
@de-vri-es
Copy link
Contributor Author

Switched to use config instead of _config directly, should fix the test failure.

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.49%. Comparing base (e4abae7) to head (4a59637).

Files Patch % Lines
src/handler/inlayHint/buffer.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5060      +/-   ##
==========================================
- Coverage   98.52%   98.49%   -0.03%     
==========================================
  Files         273      273              
  Lines       26081    26084       +3     
  Branches     5389     5390       +1     
==========================================
- Hits        25696    25692       -4     
- Misses        226      232       +6     
- Partials      159      160       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@de-vri-es
Copy link
Contributor Author

Hmm, can the test failure on nightly be related to this PR, or is it flaky? :o

@fannheyward fannheyward merged commit bdfd169 into neoclide:master Jun 27, 2024
2 of 4 checks passed
@de-vri-es
Copy link
Contributor Author

Thanks! 🥳

@SeniorMars
Copy link
Contributor

I know this is a lot to ask but we used to be able to add an icon and color of the inlay hints in our cocconfig. Would it be possible to support those features as well?

@de-vri-es
Copy link
Contributor Author

You can configure the color by changing the CocInlayHint, CocInlayHintType and/or CocInlayHintParameter syn/highlight groups (from :help coc-inlayHint).

Icon I dunno.

@de-vri-es de-vri-es deleted the inlay-hints-after-text branch June 27, 2024 16:40
@SeniorMars
Copy link
Contributor

SeniorMars commented Jun 27, 2024

I should probably make this an issue, but I'm not sure we want to support this.

In either case before (a long time ago), we used to have the following options.

 "codeLens.separator": " ",
  "codeLens.subseparator": " | ",
  "inlayHint.typeSeparator": "‣ ",
  "inlayHint.parameterSeparator": "‣ ",

@fannheyward
Copy link
Member

@SeniorMars the separator configuration has been removed and has no plan to add back, because language server will add separator like : with inlay hint, we don't want to do omitting/replacing work in client side.

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.

3 participants