-
|
Hi everyone! BackgroundI have created a transformer that enables operator overloading by replacing operators ( More details are available in this repo: https://github.com/njezersek/Adding-operator-overloading-to-TypeScript The problemEverything works fine up to this point. But as the title suggests I can't figure out how to show correct errors in the editor. Firstly I thought I could get the language server working on the transformed code (please correct me if this is not possible). So I tried to set Furthermore, I tried to patch the I also heard about writing a custom Langauge Server plugin. If that is necessary I am curious what would be the most straightforward way to get the desired result, or if this is even possible (documentation for writing a Langage Service Plugin is very discouraging https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hello. Unfortunately, patching language server does not work. I am going to deprecate it in future versions. That said, you don't need a patch to run language server plugins. Those are natively supported in the Regarding showing errors, you can show errors for pre-transformed code, as it has something to report on. Reporting errors in the IDE on transformed code wouldn't be possible, because there is nothing to highlight. I'm assuming you mean you want to report custom errors for code — this you would do with a language server plugin. If you google around, you should be able to find some examples. I know of several people who have done it; unfortunately, I don't have an exact repo to give as an example, but they are out there. People have added custom errors as well as filtered others out. Good luck! |
Beta Was this translation helpful? Give feedback.
Hello.
Unfortunately, patching language server does not work. I am going to deprecate it in future versions.
That said, you don't need a patch to run language server plugins. Those are natively supported in the
pluginsfield.Regarding showing errors, you can show errors for pre-transformed code, as it has something to report on. Reporting errors in the IDE on transformed code wouldn't be possible, because there is nothing to highlight.
I'm assuming you mean you want to report custom errors for code — this you would do with a language server plugin. If you google around, you should be able to find some examples. I know of several people who have done it; unfortunately, I don't have an exa…