deno icon indicating copy to clipboard operation
deno copied to clipboard

truncate inlay hint by setting

Open jakubdonovan opened this issue 1 year ago • 4 comments

I would like to request a feature to truncate inlay hints via a setting, similar to how VTSLS handles it. This would allow for cleaner, more concise hints in the editor, improving readability.

Could you add a setting to control inlay hint truncation?

https://github.com/yioneko/vtsls/commit/95b51bde14b098ffb4760630821027c6a2fe84da

jakubdonovan avatar Oct 14 '24 17:10 jakubdonovan

Inlay hints are directly driven by the embedded ts server. We could technically implement it ourselves but I would prefer if the suggestion was implemented upstream and we inherited it. Unless you can find a vscode setting that does this, and we can respect it.

nayeemrmn avatar Oct 15 '24 00:10 nayeemrmn

Inlay hints are directly driven by the embedded ts server. We could technically implement it ourselves but I would prefer if the suggestion was implemented upstream and we inherited it. Unless you can find a vscode setting that does this, and we can respect it.

VSC trunctates them at 30 characters by default. https://github.com/microsoft/vscode/issues/199610

jakubdonovan avatar Oct 15 '24 02:10 jakubdonovan

Then analogously it should be implemented in the editor or client-side plugin. I think you were using denols with vim?

nayeemrmn avatar Oct 15 '24 02:10 nayeemrmn

Then analogously it should be implemented in the editor or client-side plugin. I think you were using denols with vim?

Yes, I’m using denols with neovim via lspconfig. VTSLS recently added this feature in their tsserver wrapper, so it’d be great to have it here too as inlayHints (especially functionReturnTypes) get very long, sometimes taking up more than 3 lines.

https://github.com/neovim/neovim/issues/27240#issuecomment-2053854899

server based "smarter" truncation based on what's semantically relevant" sounds like the right direction

jakubdonovan avatar Oct 15 '24 02:10 jakubdonovan