mattpocock/ts-error-translator

As a "Language Service Plugin" to have broad support for IDEs besides vscode

Aperta

#51 aperta il 4 mag 2022

 (9 commenti) (18 reazioni) (0 assegnatari)TypeScript (92 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (2454 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hey 👋

So, just throwing random ideas here. Instead of a vscode extension or adding an additional package, this could be wrapped as a TypeScript Language Service Plugin.

Language Service Plugins allow to report additional errors such as from a linter and technically they should have access to original diagnostics so theoretically it'd be possible to add "translated" diagnostics along side original diagnostics.

Assuming this works, then user can simply add this to tsconfig:

{
    "compilerOptions": {
        "plugins": [{ "name": "ts-error-translator" }]
    }
}

So any IDE that uses TypeScript language service would be able to load the plugin and report errors in that IDE's native way for displaying/reporting errors/messages.


I haven't personally written a TS language service plugin before, I'm slightly familiar with the APIs thought which I learned for no reason lol. If there is interest in this I could try this out when I get some time.

Guida contributor