-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Neovim support #21
Comments
Yes please! This plugin on vim/ neovim would be a blessing. People from the community already saw it and they seem to want it badly: |
You can use https://www.npmjs.com/package/pretty-ts-errors-lsp for now to build PoC for other IDEs. |
@johnsoncodehk May I ask a question? Does pretty-ts-errors-lsp run on hover trigger? |
In VSCode plugin it's run on |
I tried it with One thing that concerns me is that when I look at the trace log, it seems like the result is being output as standard output. Trace Log
|
It should be entirely just logic in the language client, I'm not sure why it would affect the LSP trace. |
@cherryramatisdev I think johnsoncodehk's tweet would be helpful as a reference. https://twitter.com/johnsoncodehk/status/1648228278149455872 |
@yaegassy Are you using @volar-plugins/pretty-ts-errors or building a client plugin based on pretty-ts-errors-lsp? |
@johnsoncodehk I tried with |
For |
@yaegassy please update |
@johnsoncodehk I checked that the issue with the log has been resolved! Just one more thing, please allow me to confirm for the sake of being thorough. This is regarding the Markdown content of the hover response. Is there any additional processing required for "quotes" or anything else?
|
I tried it on VSCode, but since the response was the same, I assume the issue is on the client side that I'm using. I resolved it myself. 🙇 |
Bump. Would love this in NeoVim 🙏🏻 |
I started the migration to a monorepo and now I'm exporting a formatting function that can be customizable. I would be happy to test it and try to make it work with Neovim. |
Don't know if you still need help with this @yoavbls but I'm available! |
Hi @yoavbls. Do you have any thoughts or advice on how a neovim plugin should be structured? I briefly experimented trying to create one a few months back, but wasn't sure how to nicely render the final text produced by pretty-ts-errors. Do you think it's feasible to have pretty-ts-errors output in a markdown format? Then we can easily render it in neovim (or any other editor that supports markdown) with all that markdown has to offer (syntax highlighting, concealed hyperlinks, etc) |
This issue inspired me to build https://github.com/piersolenski/wtf.nvim - which uses the power of AI to both better explain Typescript errors and give you custom tailored solutions. The best part is it actually works with any language with LSP support, and any level of diagnostic message. For those who don't want to use AI, it also allows you to open a search for diagnostic messages in your favourite resources such as Google, Stack Overflow, Github Issues etc - and I plan to support other sources soon! |
Bump! |
How do we go about adding this to volar with lsp-config?
|
I suspect that most TS devs using neovim are using the built-in LSP with typescript.nvim or typescript-tools.nvim, but I don't know for sure. |
Personally, I'm using COC atm. Want to refactor my setup but that's besides the point. |
if you want, you can copy my config here: https://github.com/nfwyst/perfect-neovim-config/blob/main/lua/plugins/lsp/config.lua, im using lazy.nvim, its very fast! |
I like the structure. I'll probably take some inspiration from this! Thanks! |
Hey, |
+1, I hope this comes to something like LazyVim, I didn't get anything from above working yet |
I have been using this is vs code before moving to neovim and I dearly miss it would love this to come to neovim and I will be glad to help |
@yaegassy Hi! I tried pretty-ts-errors-lsp in coc-tsserver and got the HTML response. I think the key factor to let it work with coc.nvim is how to make the formatted HTML code show correctly in the diagnostics panel. I have tried some HTML-to-MD packages like turndown, but they are not ideal. Could you please give me some suggestions? Edit1. I just found out that coc.nvim's markdown parsing supports displaying HTML content. Maybe just some simple tweaks are needed to correctly show the diagnostics in coc-tsserver. |
https://github.com/hexh250786313/pretty-ts-errors-markdown I created a package based on pretty-ts-errors that converts the HTML output of pretty-ts-errors into markdown. Additionally, I added CLI functionality that can accept standard input from the command line. I hope this package will simplify the process of integrating pretty-ts-errors support for neovim or other IDEs capable of rendering markdown format. Moreover, for coc.nvim users, I have created an extension based on the aforementioned pretty-ts-errors-markdown. As I mentioned, it relies on markdown rendering, which, while not as perfect as HTML rendering, is sufficient. |
Have you on purpose disabled issues in your project? I would like to make a suggestion there (to expose helper function to convert just the message). |
@rchl My mistake, you can now raise an issue. Thank you for your feedback. |
+1; really need this on Noevim |
I'm not sure if it's mentioned but ts-error-translator.nvim plugin written by @dmmulroy works pretty good. |
Hi, This plugin is wonderful. Do you have any plans to support Neovim too?
The text was updated successfully, but these errors were encountered: