LSP-typescript icon indicating copy to clipboard operation
LSP-typescript copied to clipboard

Formatting snippets on hover

Open titoBouzout opened this issue 1 year ago • 5 comments

I'm not really sure how this could work, but would be great if the code snippets shown on hover could have a bit better formatting. Some typescript messages are very hard to parse, well even with formatting xD, but formatted would make the code snippets digestible. Thanks

titoBouzout avatar Feb 17 '24 03:02 titoBouzout

wrong repo, I mean to post in LSP

titoBouzout avatar Feb 17 '24 03:02 titoBouzout

More correct than LSP.

rchl avatar Feb 17 '24 15:02 rchl

There is a project that could be integrated with the server - https://github.com/yoavbls/pretty-ts-errors

Though it is currently not quite compatible with LSP as it formats messages to HTML rather than markdown (which LSP expects). Someone made some effort to create version that produces markdown output but it's not that good for now.

rchl avatar Feb 17 '24 15:02 rchl

And note that that project is about formatting typescript error messages and nothing else (you mention code snippets but I guess you meant error messages).

rchl avatar Feb 17 '24 15:02 rchl

There is a project that could be integrated with the server - https://github.com/yoavbls/pretty-ts-errors

Though it is currently not quite compatible with LSP as it formats messages to HTML rather than markdown (which LSP expects). Someone made some effort to create version that produces markdown output but it's not that good for now.

Yes, something like that project would be perfect. Wish ST supported JavaScript extensions..

titoBouzout avatar Feb 17 '24 18:02 titoBouzout