-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Truncate long inlay hints #27240
Comments
And as always, if people find this reasonable I'm more than happy to implement it :) |
Did anything come of this? looks like the PR was cancelled. Curious if you have any workarounds currently? I use TS mainly and have to disable |
@GitMurf as a user (and maintainer) of TypeScript I understand your pain. There's still a design discussion of whether this truncation should happen on the server or the client: The client would be able to provide "more universal" truncation mechanisms for several language servers, but the server is able to provide a "smarter" truncation based on what's semantically relevant. I'm All that being said, the following is my personal hack, which I don't recommend as a long term solution and I absolve myself from all negative consequences if you decide to copy-paste this into your dotfiles: https://github.com/MariaSolOs/dotfiles/blob/88646ab9bd20d6f36dacea0cdee8b6af3ffc4c50/.config/nvim/lua/lsp.lua#L275-L292 The above code should kind of reproduce the previous TypeScript behaviour. |
@MariaSolOs you are awesome! Love your work btw on both TS and neovim! saw your talk in the neovim annual conference. Appreciate all you do! That "hack" is exactly what I was looking for now! I also think an alternative "solution" (or helpful) would be this gh issue (#28261) for choosing to push inlay hints to end of line. Definitely not perfect, and lose some value, but it would be less disruptive to the code flow IMO. Lastly, I am also using your toggle on insert mode autocmds from here: #24305 Thanks! |
@GitMurf thanks for the kind words, it truly means a lot <3 I've replied to the issue you linked. I'm trying to make everyone happy, remaining on what the LSP currently allows (we can always propose for a change though ;) ). |
Problem
microsoft/vscode#199610 explains the problem, but the TLDR is that some language servers (like the TypeScript one) don't perform any truncation on inlay hints, which might result on several lines of virtual text.
Expected behavior
My proposal is to add a configuration setting (and hence easily customizable with
vim.lsp.with
) that limits the length of inlay hints.The text was updated successfully, but these errors were encountered: