jose-elias-alvarez / nvim-lsp-ts-utils

Utilities to improve the TypeScript development experience for Neovim's built-in LSP client.
The Unlicense
438 stars 18 forks source link

feat: InlayHints support #79

Closed simrat39 closed 2 years ago

simrat39 commented 2 years ago

Related to #40

Needs more work

Todo:

jose-elias-alvarez commented 2 years ago

Great! Looking forward to testing this out soon. I won't have a lot of time this month but let me know if you need anything from me.

simrat39 commented 2 years ago

This is almost done. @jose-elias-alvarez how do you think we should handle the init options utility for the user? Currently it is done like this: (note that some or all of those init_options.preferences are needed for this feature to work)

image

jose-elias-alvarez commented 2 years ago

I'm not sure how many users are modifying init_options, so maybe we could just export a table pre-filled with the required values, something like this:

lspconfig.tsserver.setup({
    init_options = require("nvim-lsp-ts-utils.init_options"),
})

And then users who need finer control can either fill the options in themselves or merge the tables manually.

simrat39 commented 2 years ago

I'm not sure how many users are modifying init_options, so maybe we could just export a table pre-filled with the required values, something like this:

lspconfig.tsserver.setup({
    init_options = require("nvim-lsp-ts-utils.init_options"),
})

And then users who need finer control can either fill the options in themselves or merge the tables manually.

Yeah that makes sense. Do we need tests for this PR?

jose-elias-alvarez commented 2 years ago

Do we need tests for this PR?

No need to worry about it IMO, since this is a visual feature and is not likely to straight-up destroy a user's project. Let me know once this is 100% ready.

simrat39 commented 2 years ago

Ready to merge from here. I'm not sure if we need to do any formatting like how rust-tools does it, IMO we should just wait for https://github.com/neovim/neovim/pull/9496

jose-elias-alvarez commented 2 years ago

This looks good to go, thanks again!